Hello,
When I call addrow function inside loop it enters last iteration data in all rows of grid. I even debug the addrow function where before calling commit(true) my data is printed ok, but when commit(true) called data is not added properly. I am calling addrow function as follows:
$.each(data, function(i, item) {
datarow[‘objectiveName’] = data[i].objectiveName;
datarow[‘objectiveTermName’] = data[i].objectiveTermName;
datarow[‘objectiveTermWeight’] = data[i].objectiveTermWeight;
var commit = $(“#objTermsGrid”).jqxGrid(‘addrow’, null, datarow);
}
and addrow function declaration is as follow:
addrow: function (rowid, rowdataToBeAdded, position, commit) {
console.log(commit);
}
Please look into this and let me know the solution.
Thanks.