jQuery UI Widgets Forums Grid getselectedrowindexes and deleterow with 1 row selected

This topic contains 1 reply, has 2 voices, and was last updated by  Martin 5 years ago.

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

  • MBTree
    Participant

    Hi,

    It seems like there are some weird results when trying to call the ‘getselectedrowindexes’ method and the ‘deleterow’ method when they are only given one row. I’ve made a fiddle based on the demo for deleterow here: http://jsfiddle.net/0d9w7sqr/

    I’ve run into these issues while testing this simple grid:

    1. Most times, but not always, if you try to delete the initially selected row (or any single selected row), the ‘getselectedrowindexes’ returns an empty array. When this happens the row is also de-selected.

    2. After deleting multiple rows, if you select one row and try to delete it, the ‘getselectedrowindexes’ returns an array with 1 id. However, passing this array to the ‘deleterow’ method does nothing.

    3. Actually, sometimes a row is deleted when passing an array of 1 id to the ‘deleterow’ method. Unfortunately when this happens, it is always the first visible row, not whatever is actually selected.

    I’d love to some clarification on whether these are bugs or just something I’m not considering.

    Thanks,
    MB


    Martin
    Participant

    Hello MB,

    When using the deleterow method of jqxGrid, you need to pass the specific row id, while selectedrowindexes returns the index of the current rows.
    So you should use the getrowid method for obtaining the id, for deleting the row.
    I have updated your Example.

    Best Regards,
    Martin

    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.