Column JSON Setup
Example:
Fields
Fields | Description | Example |
---|---|---|
id | This is the ID for the column. This is used to link the column to the data. |
|
header | This is what shows up as the title of the column. |
|
order | This is the order in which the column shows up in the table. |
|
type | The type of field for the column's cells. Can be defined as text, hidden, dropdown, autocomplete, checkbox, radio, calendar, image, or color. See more details below |
|
columnWidth | The width of the column in px. Should be a number |
|
readOnly | Set if the column is editable. true of false |
|
source | Source is only used for dropdown and autocomplete columns. This allows you to define the options that will show up in the dropdown. Should be an array |
|
align | Align the text for the column. Options: left, right, center |
|
multiple | Only used if the type is "dropdown" or "autocomplete". Determines whether or not multiple options can be selected. |
|
mask | Used if you want to format your text OR if you want to only allow numbers to be entered (the easiest way is to just set "mask": "0" ). See more on masks here. |
|
decimal | Select the type of decimal used with numbers / masks. (For example, choose "," and your format will be $2.500,00). Default is "." |
|
options | This it to apply advanced options, and is currently only used for calendars. See more about option types here. |
|
default | Set a default value for blank cells. Can also be used to set static data to your JSON if you set the field as "hidden" (for example, if you want to add the bubble ID of a thing to all values) |
|
forceString | Forces the value of the cell to always output a string, instead of a numeric or boolean value. (useful if you use this in scripts or regex later) |
|
Column types
Type | Description |
---|---|
text | Default option, providing a normal text input. (If you want to allow only numbers to be inputted, add a "mask" field) |
| Allow only numbers to be inputted. To do this, follow the instructions here. |
hidden | Hide the column. Useful if you have a lot of data, but only want to show certain columns. See more on this here |
dropdown | Choose from a set list of values. Define this list by adding a "source" field |
autocomplete | Similar to dropdown, but allows you to type and filter results. Useful if you have a lot of data |
checkbox | True or false field |
radio | Similar to checkbox, but only able to select one field per column |
calendar | Select a date from a calendar popup. See advanced options here |
image | Displays an image. Define what the image is by adding a "data" field |
color | Allows you to pick a color using a color picker popup |
Default settings
To define the default settings for your columns, you can add an extra row to the JSON columns with a blank ID.
You can set a few or as many settings as you want. For example, if you want all of your columns to be readOnly, you can add "readOnly": true
.
Auto-binding
You are able to auto-bind the JSON Data field to the parent's text field. Your JSON will be saved to the DB automatically once changed are made. When loading up the page, this will set the table based on what's saved in the DB, and will override the normal JSON data field in the plugin panel.
If data changes in the DB, you'll need to call the "refresh table" action in order for the changes to show up.
Last updated