jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › Maximum call stack size exceeded Error
This topic contains 6 replies, has 2 voices, and was last updated by Peter Stoev 9 years, 7 months ago.
-
Author
-
Hi there,
I’m using jqxTreeGrid for my project. My tree has maximum 5 levels.
I’m using updaterow event for updating a row’s data. but I face this error!
this is the code:
var source = {
datatype: ‘json’,
datafields: [
{ name: ‘id’, type: ‘int’, align: ‘left’},
{ name: ‘name’, type: ‘string’, align: ‘left’},
{ name: ‘code’, type: ‘string’ , align: ‘left’}
],
timeout: 10000,
id: ‘code’,
root: ‘rows’,
url: url,
updaterow: function (rowid, rowdata, commit) {
var data = rowdata;
try {
var jqxhr = $.post(‘updateSample.php’, {
data: rowdata
}, function () {
// do something
});
}
catch (error) {
console.log(error.message);
}
}
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#jqxgrid”).jqxTreeGrid({
width: 900,
source: dataAdapter,
pageable: true,
sortable: true,
editable: true,
theme: ‘darkblue’,
columns: [
{ text: ‘Id’, datafield: ‘id’, cellsAlign: ‘left’, pinned: true, editable: false},
{ text: ‘Name’, datafield: ‘name’, cellsAlign: ‘center’},
{ text: ‘Code’, datafield: ‘code’, cellsAlign: ‘center’},
],
virtualModeCreateRecords: function (expandedRecord, done) {
var dataAdapter = new $.jqx.dataAdapter(source,
{
formatData: function (data) {
if (expandedRecord == null) {
data.parentId = -2
}
else {
data.parentId = expandedRecord.code
}
return data;
},
loadComplete: function()
{
done(dataAdapter.records);
},
loadError: function (xhr, status, error) {
done(false);
}
}
);
dataAdapter.dataBind();
},
virtualModeRecordCreating: function (record) {
// do something
},
});Hi rasoul_par,
Provide, please jsfiddle.net sample which demonstrates your issue. Also, why do you set parentId? I don’t suggest you to do that.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI’m not doing anything more than php integration demo.
If I use plain javascript or aja.js ajax and it fixed.Thanks for your quick response and great widgets!
Hi rasoul_par,
We do not have such demo about TreeGrid and we don’t set parentId property in our TreeGrid demos when Data Records are loaded on demand. Please, provide jsfiddle.net demo if you would like our team to test your scenario.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
I’ll provide a demo and inform you.
Sorry for delay.Hello there,
sorry for being late, the jsfiddle is here.
I’m using Symfony 2.7 as my php framework.
when i replace jquery post function by aja.js ajax functions, the error vanishes.
Thanks.Hi rasoul_par,
Please, check whether you Add Records with unique ID/Key. That exception is raised by jqxTreeGrid and is raised in your sample. I also noticed that your keyDataField and parentDataField are the same. Should they be? I think that they should be different.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.