jQWidgets Forums

jQuery UI Widgets Forums Grid dynamic updating grid

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 13 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • dynamic updating grid #3210

    pwenk
    Participant

    Hi,

    i’m working on a dynamic event list based on jqxgrid. Before calling jqxgrid the first time i load the column layout and the actual data via $.ajax(..) into a local object and then i prepare the grid based on this data.

    After that, i start polling the server for updates. The servers delivers a list of new, deleted and modified rows. For each modification i use the coresponding method to process the update :

    $(“eventlist”).jqxGrid(‘updaterow’,Id, Row)
    $(“eventlist”).jqxGrid(‘addrow’,Id, Row)
    $(“eventlist”).jqxGrid(‘deleterow’,Id);

    so far so good. If one update contains many changes then the job takes very long und the Browser nearly hangs.

    Is there a more efficient way to perform the update ?

    Best Regards,
    Peter Wenk

    dynamic updating grid #3211

    Peter Stoev
    Keymaster

    Hi Peter,

    Each call of the ‘updaterow’, ‘addrow’ or ‘deleterow’ method will refresh the Grid. As far as I understand, you need a behavior which works as a transaction, i.e add, update or delete many rows simultaneously and update the Grid after the end of the transaction. This logic, unfortunately is currently not implemented in the Grid.

    The following is after the release of jQWidgets 2.0:

    Before adding, deleting or updating many data records, you will have to call the ‘beginupdate’ method and after the update, call the ‘resumeupdate’ method to refresh the Grid.

                    $("#jqxgrid").jqxGrid('beginupdate');
    for (var x = 0; x < 100; x++) {
    var datarow = generaterow();
    $("#jqxgrid").jqxGrid('addrow', null, datarow);
    }
    $("#jqxgrid").jqxGrid('resumeupdate');

    Best Regerds,
    Peter Stoev

    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.