jquery - Maximum call stack size exceeded Kendo Ui -
i make call jquery function after client select , find myself problem :
kendo.all.js:5282 uncaught rangeerror: maximum call stack size exceeded @ function (<anonymous>) @ o.filter (kendo.all.js:5282) @ kendo.all.js:5303 @ u (kendo.all.js:4901) @ o.select (kendo.all.js:5243) @ o.group (kendo.all.js:5302) @ function.o.process (kendo.all.js:5473) @ init._queryprocess (kendo.all.js:6877) @ init._process (kendo.all.js:6867) @ init._change (kendo.all.js:6834)
i found in lines set () function error, when change function (=) , fetch of grid problem terminated, not know c ' solution, assemble part of code
function getplanformation1() { var prj = $("#prj").val(); $.ajax({ type: 'get',` url: urlroot + 'formation/readplanformation?client=' + cl + "&projet=" + prj, success: function (data) { (var = 0 ; < data.length; i++) { var dataitem = dsthemeformation.get(data[i].id); console.log("data", data); if (data[i].prjact) { dataitem.checked = true; dataitem.nbj = data[i].j; dataitem.id_org = data[i].org; } else { dataitem.idp = data[i].idp; } } }, error: function (xhr) { if (prj == undefined) { } if (cl == undefined) { } } }); }
using set()
method of dataitem trigger change
event of grid datasource instance, in turn rebind grid. that's why, calling set()
large number of times granular data item updates bad performance , causes javascript error.
i recommend populating standalone array of plain objects in success
callback, , assign whole array new grid datasource via datasource's data()
method. in way have 1 change
event firing, , 1 grid rebind.
Comments
Post a Comment