allows setting custom flag for a data item.
id | string | the id of a data item to mark |
name | string | the flag name |
css | boolean | if set to true, the css style with the name equal to the name parameter value will be applied to the marked item |
value | any | the value of the flag |
silent | boolean | (optional) if set to true, the component is not redrawn |
any | the flag value |
//adds flag 'invaid = true' for the item with 'id=2'.
//applies to this item css style ".invalid"
$$("dtable").addMark(2, "invalid", true, true); // returns 'true'
The method adds some info (as a key/value pair) related to a data item, marking the item thereby. The added information is stored separately from main data. So if you, for example, load data from one data store to multiple components, the mark will exist just for a data item of the calling component.
The method can be called in 4 ways:
addMark(id, name) //-> 'css' is set to false, 'value' - to true
addMark(id, name, css) //-> 'value' is set to true
addMark(id, name, css, value)
addMark(id, name, css, value, silent) //-> 'silent' is set to true, do not refresh the component