define

redefines a single configuration property (or a hash of properties)

void define(string property,any value);

Parameters

propertystringthe property name or a hash of properties that needs redefining
valueanythe new property value

Example

// redefines the width of the list
$$("mylist").define("width", 300);
$$("mylist").refresh();
 
// changes the label of the button
$$("button1").define("label", "New value");
$$("button1").refresh();
 
// changes multiple properties at once
$$("text2").define({
    value:"123",
    label:"New label"
});
$$("text2").refresh();

Related samples

Details

The component should be refreshed to make the changes come into force.

Redefining "config" object

You can use the config property to get the desired configuration option:

var width = $$("myList").config.width;

config is especially useful when a property is presented by an object:

var fieldWidth = $$("myGrid").config.fields["field_1"].width;

Note, in this case after $$("component_id").config you should write the complete dependency property inheritance chain.

See also
Back to top