DHTMLX Docs & Samples Explorer

add (obj, index)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxdataview.js

adds a data item to the dataview

  • obj - the item object;
  • index - (optional) the item position (zero-based numbering).
var view = new dhtmlXDataView({
     container:"data_container",
     type:{
         template:"#Package# : #Version#<br/>#Maintainer#"
     }
});
view.add({
     id:15,
     Package:"test one",
     Version:"0.1",
     Maintainer:"dhtmlx" 
}, 0)

Note,

  • If the index parameter isn't specified in the method, the item will be added to the end of the list.
  • If the id property isn't specified for the item - it will be auto generated.

See also: