Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Updating igGrid with JSON data
posted

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:

TypeError: g[(w + d.owner._startRowIndex)] is undefined
...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.

Parents
No Data
Reply
  • 195
    Suggested Answer
    posted

    Will this error be solved in Infragistics 13.1?

    I still get the error sometimes. For example:

    I delete a row in my grid -> Working great, all fine

    I add a row in the grid -> Still fine, row is added etc.

    I add another row to the grid -> The row is added succesfully, but then the error above occurs.

    It's no problem if I add a few rows without deleting one first. I can't imagine I am doing something wrong...

Children