Dynamic ui modification for columns

Hi everybody,

I am quite annoyed because my program doesn’t work; i just want to make dynamic column’s json for my view.

Initially :

grid = webix.ui({
				container:"testA",
				view:"datatable",
				columns:[
					{ id:"rank",	header:"", css:"rank" },
					{ id:"title",	header:"Film title" },
					{ id:"year",	header:"Year"},
					{ id:"votes",	header:"Votes"}
				],
			});	

But now I want to change my json array dynamically calling a method like this :

grid = webix.ui({
				container:"testA",
				view:"datatable",
				columns: getJson(id, header, width), 		
			});	

currently, my fonction return something like that in my console when i do it:
console.log(getJson(id, header, width));

[{ id:“rank”, header:“rank”, width=80 },{ id:“title”, header:“title”, width=80 }]

I get thoses errors :
‘TypeError: a is undefined webix.js:626:139
TypeError: t is undefined’

Does it exist other manner to replace static json by a method in column view ?

Do you really have a “width=80” in JSON? As it must be “width:80”

Anyway, the above use-case is fully valid. Check that result of getJson is really an array of objects and that id doesn’t contain empty elements.

Also, try to use the webix_debug.js it will show some more meaningful error message.

tks