addMark

allows setting custom flag for a data item.

any addMark(string id,string name, [boolean css,any value] );

Parameters

idstringthe id of a data item to mark
namestringthe flag name
cssbooleanif set to true than the css style with the name equal
to the name parameter value will be applied to the marked item
valueanythe value of the flag

Returns

anythe flag value

Example

//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'

Details

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 3 ways:

  1. addMark(id, name) //-> 'css' is set to false, 'value' - to true
  2. addMark(id, name, css) //-> 'value' is set to true
  3. addMark(id, name, css, value)
See also
Back to top