Skip to content
vad edited this page Aug 18, 2010 · 2 revisions

Every widget can use configurable parameters. A parameter must be declared in the widgets database table. A configurable widget has to expose its prefs in the user_params field. An example:


[{ "name": "url" ,"description": "URL" ,"type":"string" }]

Parameters definition

field description
name a name for the param (must be unique)
description A (maybe long) description
type The type of the field, see below for possible choices

Parameters type

You can save all your data as strings, of course. The main benefit of choosing the right data type is the automatic widget configuration panel.
You can choose parameter type among:

type description input type
integer for numeric data (no floating point) text, but will become a slider
string for strings text
color for hexadecimal colors Extjs pickcolor
boolean boolean data checkbox
BooleanList a list of choiches A list of checkboxes

where the input type refers to the configuration panel.

Clone this wiki locally