jQWidgets Forums

jQuery UI Widgets Forums Grid Refresh after changing data

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Refresh after changing data #95774

    jeffo
    Participant

    I have a grid. It is bound to an array loaded from JSON, datatype: “local”.

    Each row has an edit button which displays a modal, edits the entry, saves it to the database (via web api) and is supposed to update the grid.

    The Web Api Put method, returns the new object, which I replace with array.replace(olditem, newitem).

    I have tried calling “refresh”, “refreshdata”, “updatebounddata” (with no option, and with “cells”, and “filter” options)

    updatebounddata doesnt seem to work well if there is one or both filter or sort applied to the grid. the grid randomly changes the sort order or loses my filter.

    refresh and refreshdata, work sometimes. Generally my row has a name property, and if I update it to a value of different string length the grid will refresh, otherwise it will not.

    How can I accomplish an update of the grid, while maintaining filters and sort orders?

    thanks.

    Refresh after changing data #95938

    Hristo
    Participant

    Hello jeffo,

    The correct way to achieve this is to use updatebounddata with additional arguments “filter” and second time with “sort”.
    $('#jqxGrid').jqxGrid('updatebounddata', 'filter'); $('#jqxGrid').jqxGrid('updatebounddata', 'sort');
    I tested this method and it seems to work fine.

    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.