NEW VERSION RELEASED! Webix 11 Read More Core Updates, Extended Functionalities in SpreadSheet and File Manager and more

Complex Layout - Performance, programming examples of Complex Layout - Performance

Complex Layout - Performance

Get this JavaScript programming example that allows creating complex layouts for web applications. Don't miss the opportunity to use other free coding samples by Webix for your web development projects.

JS Code

var count = 0;
function config(obj, mode, level, size){
  var set  = obj[mode] = [];
  obj.margin = level*2;
  var nextmode = (mode == "rows") ? "cols" : "rows";

  for (var i = 0; i < size; i++) {
    if (level) set[i] = config({ type:"wide" }, nextmode, level-1, size);
    else set[i] = { template:"-" };
  }
  count += size;
  return obj;
}

//high precision performance counters
var performance = window.performance || Date;

var ui = config({}, "rows", 10, 2)
var start = performance.now();
webix.ui(ui);
webix.delay(function(){
  var end = performance.now();
  webix.message(count + "views<br>" + Math.round((end-start)*100)/100+"ms")
})