Hi,
I am trying to reload the data in my Infragistics grid using a knockout datasource. I have got the following code:
MYNAMESPACE.gridFunctions.prototype.refresh = function (data) { if (data == undefined) { $(".ajax-loader").css("display", "block"); MYNAMESPACE.gridFunctions.prototype.read(undefined, MYNAMESPACE.gridFunctions.prototype.refresh) return; } MYNAMESPACE.viewModel.books = ko.mapping.fromJS($.parseJSON(data)); ko.applyBindings(MYNAMESPACE.viewModel); $(".ajax-loader").css("display", "none"); };
"MYNAMESPACE.gridFunctions.prototype.read" is a REST/AJAX function which gets JSON data from the server.
When testing the functionality it seems to work, but the second refresh I get the following error:
...ngth-1][d.options.primaryKey])}}else{if(f().length>h.length){k=f()[f().length-1]...
I have no idea what might be wrong.. anyone?
Thanks in advance.
Hello Stagiair ,
I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
I wasn’t able to run your sample since it doesn’t include the data source used so it throws an error that it cannot connect .
Could you let me know which is the exact page in questions?
In general I noted you have a grid defined in the App_Code folder which is using knock out. However I didn’t notice any update url being defined for the grid so most probably you’re handling the updating manually somewhere in your code. Could you let me know where exactly where you’re triggering the request to the server and also after you update the data source on the server do you send the updated data to the client as the data source of the grid?
In general the error seems to be due to the data source of the grid not being properly updated.
I’m looking forward to your reply.
Developer Support Engineer II
The original error seems to have been fixed with an update.
Now however I get the following error when adding a row an then selecting it:
...ewrow"){return tx[i].row[colKey]}}}}if(this.options.primaryKey!==null){primaryKe...
So I:
The '80' in the error is the primary key (ID) of the record I added and selected.
Thank you for your reply.
I will attach a .rar with my project. I deleted some of the bigger files in my project I think aren't necessary. I am not that familiar with ASP.NET, so if any files are missing, please tell me.
Hello Erwin,
I'm not sure what the problem is. Can you provide a sample reproducing the issue for me to investigate?
Best regards,Martin PavlovInfragistics, Inc.