jQWidgets Forums

jQuery UI Widgets Forums Grid Reload data into grid using Filereader

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 8 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • robf
    Participant

    Hi,

    I’m testing jqxgrid whereby I use HTML FileReader to read and load a json file into the grid. The grid is set up to use ‘localdata’ which is kept in a variable once the data is read from the file.

    What is the recommended way to reload the grid with the new data after the user selects another file. I understand the approach may be the same regardless of where the data comes from, but I want to make sure I’m not recreating the grid when I reload.

    I tried to use the following but it doesn’t to work as expected as the grid is not updated nor refreshed.

    // gridSource defined once
    gridSource.localdata = myFileContent;
    $("#jqxgrid").jqxGrid('updatebounddata', 'cells');

    Any direct assistance or links would be appreciated!
    Rob


    Hristo
    Participant

    Hello Rob,

    The updatebounddata method – updates the bound data and refreshes the grid.
    No matter from where you get the data, you need to update the source and should use ‘updatebounddata’ method.
    Please, take a look at this example.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.