addMark

allows setting custom flag for a data item.

any addMark(string id,string name, [boolean css,any value,boolean silent] );
idstringthe id of a data item to mark
namestringthe flag name
cssbooleanif set to true, the css style with the name equal
to the name parameter value will be applied to the marked item
valueanythe value of the flag
silentboolean(optional) if set to true, the component is not redrawn
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 4 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)
  4. addMark(id, name, css, value, silent) //-> 'silent' is set to true, do not refresh the component
See also
Back to top