jQWidgets Forums

jQuery UI Widgets Forums Grid issue when re-rendering jqxGrid

This topic contains 5 replies, has 3 voices, and was last updated by  Damian 8 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • issue when re-rendering jqxGrid #4712

    blinkins0n
    Member

    Hi all,

    I was testing the jqxGrid and it works fine but I have an issue when re-freshing the grid.

    Based on the example:
    jqwidgets-ver2.2/demos/jqxgrid/grouping.htm

    I wrapped the javascript code in a function called RunGrid();

    // $(document).ready(function () {

    function RunGrid() {

    var theme = ”;

    var url = “../sampledata/customers.xml”;
    var parentsLength = $(“#jqxWidget”).parents().length;
    if (parentsLength > 3) {
    url = ‘demos/sampledata/customers.xml’;
    }

    // prepare the data
    var source =
    {
    datatype: “xml”,
    datafields: [
    { name: ‘CompanyName’, map: ‘m\\:properties>d\\:CompanyName’ },
    { name: ‘ContactName’, map: ‘m\\:properties>d\\:ContactName’ },
    { name: ‘ContactTitle’, map: ‘m\\:properties>d\\:ContactTitle’ },
    { name: ‘City’, map: ‘m\\:properties>d\\:City’ },
    { name: ‘PostalCode’, map: ‘m\\:properties>d\\:PostalCode’ },
    { name: ‘Country’, map: ‘m\\:properties>d\\:Country’ }
    ],
    root: “entry”,
    record: “content”,
    id: ‘m\\:properties>d\\:CustomerID’,
    url: url
    };

    // Create jqxGrid
    $(“#jqxgrid”).jqxGrid(
    {
    width: 600,
    source: source,
    groupable: true,
    sortable: true,
    theme: theme,
    columns: [
    { text: ‘Company Name’, datafield: ‘CompanyName’, width: 250 },
    { text: ‘City’, datafield: ‘City’, width: 120 },
    { text: ‘Country’, datafield: ‘Country’ }
    ],
    groups: [‘City’]
    });

    }

    //});

    So the first time I call RunGrid(); the performance is fine, but if I try a second time the image “loader.gif” doesn’t appear and the grid looks with different styles. Not properly rendered.

    Any idea why re-rendering the jqGrid is being so complicated?

    Thanks in advance.

    issue when re-rendering jqxGrid #4713

    Peter Stoev
    Keymaster

    Hi blinkins0n,

    The correct way to refresh the Grid, if you want to refresh the data is to call the ‘updatebounddata’.

    $(“#jqxgrid”).jqxGrid(‘updatebounddata’);

    If you want to refresh only the UI, without the data, use the Grid’s refresh method.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    issue when re-rendering jqxGrid #4715

    blinkins0n
    Member

    Hi Peter,

    I just found the solution:

    http://www.jqwidgets.com/community/topic/error-reloading-grid/

    It works just fine. I think that’s the best solution since I’ll be calling Server side to call the “var source”.

    Thanks anyway!

    issue when re-rendering jqxGrid #4716

    Peter Stoev
    Keymaster

    Thanks for the update!

    Best Wishes,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    issue when re-rendering jqxGrid #90925

    Damian
    Participant

    Hi all,

    My problem is that, I use $(“#jqxgrid”).jqxGrid(‘updatebounddata’); in my jqxGrid but when I refresh the grids, these are marked in gray color but the grid it doesn´t filter.

    Thanks anyway.

    issue when re-rendering jqxGrid #90926

    Damian
    Participant

    Hi all,
    My problem is that, I use $(“#jqxgrid”).jqxGrid(‘updatebounddata’); in my jqxGrid but when I refresh the grids, these are marked in gray color but the grid it doesn’t filter.
    Thanks anyway.

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

You must be logged in to reply to this topic.