LogoLogo
FeaturesHelp & ResourcesShowcasePricingLogin
Squirrel Addon Documentation
Squirrel Addon Documentation
  • README
  • Table of contents
  • Building an addon
    • Communication
    • Property Panel
      • Property Panel Elements
        • Accordion
        • Checkbox
        • Color Input
        • Conditional Logic
        • Dropdown
        • Font
        • Horizontal Line
        • Input Box
        • Radio Button
        • Series
        • Sub Accordion
        • Text Label
    • Publishing an addon
      • Restricting private addons
      • The review process
      • Add-on submission
        • Icon guidelines
        • Image guidelines
  • introduction
    • Joining the Developer Program
  • past-events
    • Building your first add-on
  • squirrel-helper-library
    • Dot notation
    • Angular
      • Classes
        • SquirrelCanvas
        • SquirrelColor
        • SquirrelMessage
        • SquirrelPosition
        • SquirrelSize
      • Events
        • onInitState
        • onPropertyChange
        • onPropertyChangesComplete
        • onSetCanvas
        • onSetPosition
        • onSetRuntimeMode
        • onSetSize
      • Getting Started
        • Building your first addon
        • Debugging
        • Sending and Receiving Data
        • The JSON files
      • Methods
        • getBindingDimension
        • getCanvas
        • getCopyOfState
        • getGenericProperty
        • getPosition
        • getRuntimeMode
        • getSize
        • initWithSquirrel
        • parseColor
        • sendToSquirrel
        • setPosition
        • setSize
        • shadeColor
        • tintColor
    • JavaScript
      • Classes
        • SquirrelCanvas
        • SquirrelColor
        • SquirrelMessage
        • SquirrelPosition
        • SquirrelSize
      • Events
        • onInitState
        • onPropertyChange
        • onPropertyChangesComplete
        • onSetCanvas
        • onSetPosition
        • onSetRuntimeMode
        • onSetSize
      • Getting Started
        • Building your first add-on
        • Debugging
        • Sending and Receiving Data
        • The JSON files
      • Methods
        • getBindingDimension
        • getCanvas
        • getCopyOfState
        • getGenericProperty
        • getPosition
        • getRuntimeMode
        • getSize
        • initWithSquirrel
        • parseColor
        • sendToSquirrel
        • setPosition
        • setSize
        • shadeColor
        • tintColor
    • React
      • Coming Soon
Powered by GitBook
LogoLogo

Explore

  • Home
  • Features
  • Pricing
  • Download Squirrel

Help

  • Learn
  • Community
  • Support
  • FAQ's

Updates

  • Blog
  • Events
  • Release Notes

Company

  • Contact Us
  • Privacy Policy
  • Terms of Use

Copyright © 2019 - 2024 InfoSol Ltd. All rights reserved.

On this page

Was this helpful?

  1. Building an addon
  2. Property Panel
  3. Property Panel Elements

Series

PreviousRadio ButtonNextSub Accordion

Last updated 3 years ago

Was this helpful?

{
    "type": "Series",
    "properties": {
        "labelName": "Data",
        "nameSuffix": "Series"
        "noun": "Series",
        "bindingPropertyName": "data"
    },
    "template": [
        {
            "type": "InputBox",
            "properties": {
                "labelName": "Name:",
                "allowBinding": true,
                "allowManualEntry": true,
                "bindingPropertyName": "id"
            }
        },
        {
            "type": "InputBox",
            "properties": {
                "labelName": "Input Box 1:",
                "allowBinding": true,
                "allowManualEntry": false,
                "bindingPropertyName": "input1"
            }
        },
        {
            "type": "InputBox",
            "properties": {
                "labelName": "Input Box 2:",
                "allowBinding": true,
                "allowManualEntry": false,
                "bindingPropertyName": "input2"
            }
        },
        {
            "type": "ColorOpacityInput",
            "properties": {
                "labelName": "Color Input",
                "bindingPropertyName": "colorInput",
                "allowCheckbox": true,
                "hasOpacity": false
            }
        },
        {
            "type": "HR",
            "properties": {}
        },
        {
            "type": "Label",
            "properties": {
                "text": "Some Text here"
            }
        },
        {
            "type": "InputBox",
            "properties": {
                "labelName": "Input Box 3:",
                "allowBinding": true,
                "allowManualEntry": true,
                "bindingPropertyName": "input3"
            }
        },
        {
            "type": "HR",
            "properties": {}
        },
        {
            "type": "HTMLLabelElement",
            "properties": {
                "text": "Check boxes:"
            }
        },
        {
            "type": "Checkbox",
            "properties": {
                "labelName": "Check box 1",
                "bindingPropertyName": "checkbox1"
            }
        },
        {
            "type": "Checkbox",
            "properties": {
                "labelName": "Check box 2",
                "bindingPropertyName": "checkbox2"
            }
        }
    ],
    "templateState": {
        "id": "Series 1",
        "input1": "",
        "input2": "",
        "input3": ""
        "colorInput": {
            "color": [
                {
                    "color": "#5a5a5a",
                    "alpha": 1,
                    "ratio": 0
                }
            ],
            "enabled": true,
            "weight": 2
        },
        "checkbox1": true,
        "checkbox2": false
    }
}

The property name needs to match the string specified in bindingPropertyName property. The value will be the default value to show in the input box.

{
    "data": {
        "series": [
                {
                    "id": "Series 1",
                    "input1": "",
                    "input2": "",
                    "input3": ""
                    "colorInput": {
                        "color": [
                            {
                                "color": "#5a5a5a",
                                "alpha": 1,
                                "ratio": 0
                            }
                        ],
                        "enabled": true,
                        "weight": 2
                    },
                    "checkbox1": true,
                    "checkbox2": false
                }
            ]
        }
    }

The series pseudo element allows for the end user to add values to an array in state. There are three sections to a series.

Series root property definition

This is where you specify the array property from state and cosmetic properties such as name, noun etc

Series template definition (orange box in the image).

This is where you specify the template child elements to appear for each item in the series / array. The template can contain any of the other property panel elements.

You will configure the template child property panel elements as normal, and the root property name and it's position index in the array will automatically be attached to the start of the bindingPropertyName for you. For example:

If you have a series call data, with a template child text input with a bindingPropertyName of "title". Referencing that title property in code you will use data[0].title

For a more detailed example you can see the template section in the property panel json above

Series template state

With the series template definition you specify what property elements you want for each of the items added to your series array. The series template state section is where you specify the state structure for these elements.

For a more detailed example you can see the templateState section in the property panel json above

Configurable properties

bindingPropertyName

string - the parent property name from defaultState with which to connect to.

mandatory

labelName

The title to give the series creation and selection element in the property panel

nameSuffix

This is the name to appear next to the label on the property element. The default value is "series".

noun

This is the name of the series to be created when the add series button is clicked. The next number in sequence is added to the series on creation. Eg if there is already an item in the array called "Series 1" and the noun is "Series" the next item created will be "Series 2"

Note in build 1.11.x it is not possible to have a series element as a child of another series element. This functionality was added in build 1.12.x