23 days to give it a try before you buy! Download now. The best deals on licenses are coming soon Download now. The best deals on licenses are coming soon

Tree: Plain JSON Data with Client-side Grouping, programming examples of loading plain JSON data with client-side grouping to DataTree

JavaScript code of loading plain JSON data with client-side grouping to DataTree

Get a JavaScript programming sample for loading plain ("one-level") JSON data with client-side grouping to DataTree. JavaScript Tree UI widget allows presenting hierarchically organized information in a logical manner. By means of our JS coding sample you can load plain JSON data and group it in nodes on the client side. Don't miss a chance to use our programming examples or a snippet tool below to make web applications.

JS Code

/*
  In this sample Tree data are grouped by year.
*/

//plain json data, based on objects
webix.ui({
  view:"tree",
  scheme:{
    $group:"year",
    $sort:"value"
  },
  ready:function(){
  	this.openAll();
  },
  data: [
    { id:1, value:"The Shawshank Redemption", year:1994, votes:678790, rating:9.2, rank:1},
    { id:2, value:"The Godfather", year:1972, votes:511495, rating:9.2, rank:2},
    { id:3, value:"The Godfather: Part II", year:1974, votes:319352, rating:9.0, rank:3},
    { id:4, value:"The Good, the Bad and the Ugly", year:1966, votes:213030, rating:8.9, rank:4},
    { id:5, value:"Pulp fiction", year:1994, votes:533848, rating:8.9, rank:5},
    { id:6, value:"12 Angry Men", year:1957, votes:164558, rating:8.9, rank:6}
  ]
});

How to load plain JSON data with client-side grouping to DataTree?