jQuery UI Widgets Forums Grid Problem with beginedit and endedit when using aggregates

This topic contains 2 replies, has 2 voices, and was last updated by  toBeBetter 10 years, 11 months ago.

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

  • toBeBetter
    Member

    In my application, I want to hide several columns.

    In the beginning, I use this code to solve it:

    $("#jqxgrid").jqxGrid('hidecolumn', 'customer');
    $("#jqxgrid").jqxGrid('hidecolumn', 'supplier');
    ...

    It works fine but slow, and then I found a solution by
    Peter Stoev:

    Each of these hide/show calls will refresh the Grid so in your code you will have 16 unnecessary refreshes. To avoid that, before making such operations use the Grid’s beginupdate and endupdate methods. Call beginupdate before calling multiple methods and endupdate after that.

    $('#jqxgrid').jqxGrid('beginupdate');
    $("#jqxgrid").jqxGrid('hidecolumn', 'customer');
    $("#jqxgrid").jqxGrid('hidecolumn', 'supplier');
    ...
    $('#jqxgrid').jqxGrid('endupdate');

    It works fine and as fast as expected…

    When I use aggregates with this columns, something bad happens:

    Columns hide but aggregates still there…

    Can anyone help me?


    Dimitar
    Participant

    Hello toBeBetter,

    This issue can be resolved by calling the method renderaggregates before endupdate, i.e.:

    $("#jqxgrid").jqxGrid("beginupdate");
    $("#jqxgrid").jqxGrid("hidecolumn", "customer");
    $("#jqxgrid").jqxGrid("hidecolumn", "supplier");
    $('#jqxgrid').jqxGrid("renderaggregates");
    $("#jqxgrid").jqxGrid("endupdate");

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    toBeBetter
    Member

    Hi Dimitar,

    thanks a lot for reply,

    it worked!

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

You must be logged in to reply to this topic.