jQWidgets Forums

jQuery UI Widgets Forums Grid Destroy method in compatibility view with latest version

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

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

  • toBeBetter
    Member

    For some reasons, each time I click a button, I need to destroy the grid and rebuild it.

    $('#search').on('click', function () {
    $('#jqxgrid').jqxGrid('destroy');
    InitGrid();
    }

    It works fine in compatibility view(IE) with version 3.0.2.

    With latest version 3.0.3,

    “Destroy” method just destroy the first row,

    and error happens:”object doesn’t support this action” in jqxgrid.js “delete o.cells;”

    How does it happens?


    Peter Stoev
    Keymaster

    Hi toBeBetter,

    We confirm that behavior under IE7(which is actually the compatibility View of IE7+ browsers). As a work around, select the Grid with jQuery and call the jQuery’s remove method. However, I do not really suggest you to dynamically destroy, create new Grids when you want to update Grid data. There are methods about that like “updatebounddata”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    toBeBetter
    Member

    Hi Peter Stoev,

    thanks for your help.

    The reason why I need to destroy the grid is that when I search data,

    the columns changes(more or less by search conditions: “start date” and “end date”).

    For example:

    Init: “start date” =2013/10/17 , “end date”=2013/10/18

    there would be two columns named by date;

    when I change “end date” to 2013/10/19 and click “search” button,

    get data and call “updatebounddata” method,

    the data refreshed but there still two columns, not three as expected.

    The only way I found was to destroy the grid and rebuild it ,

    do you have any better ideas?


    Peter Stoev
    Keymaster

    Hi toBeBetter,

    Please, look at my previous post. The workaround I suggested you is to use the jQuery’s remove() method.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    toBeBetter
    Member

    Thanks Peter,

    jQuery’s remove() method

    performance better!

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

You must be logged in to reply to this topic.