Check documentation for the latest version of dhtmlxSuite Data Scheme DHTMLX Docs

Data Scheme

Data scheme allows setting a default scheme for data records of DataStore. So in cases when you add an empty record to DataStore (data.add({})), the record will be populated with the values set by the scheme.{
    department: "Unknown"
//will add {name:"Unknown",gender:"male",age:25,department:"Unknown"} record

There are also 2 special keys you can use in a scheme:

  • $init - called during initial object creation

    Let's assume you want to populate a combo with data from some column of db (e.g. column 'name' with the names of departments). To make the combo recognize the names of departments as options, combo should get data as sets of 'text' and 'value' parameters. In this situation the $init key is useful:{
            obj.value =;  // 'name' is the name of the column from the db
            obj.text =;
  • $update - called each time after data changing{
            obj.text = + " " + obj.number;
Back to top