jQuery UI Widgets Forums DataTable Delete row on page which is not visible

This topic contains 4 replies, has 2 voices, and was last updated by  patrick 9 years ago.

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

  • patrick
    Participant

    Hi,

    Is it possible to delete a row that is on a page which is not visible. As an example if i set pageSize to 20, have 40 rows in the table and currently on page 1, then try to delete any row above 20 I get a TypeError: Cannot read property ‘seleected’ of undefined.

    Is it possible to delete a row on a page not currently visible, preferably without changing the page.

    Thanks

    Delete row on page which is not visible #82802

    ivailo
    Participant

    Hi patrick.fay,

    In your case you are trying to delete row that is not defined. If this row has been created before, it will be possible to delete it.
    So, try this workaround :
    – initialize the DataTable as pageable: false,
    – when the DataTable is initialized set pageable:true with your preferred pager’s settings
    With this workaround, you will create all the rows and it will be possible to delete each of them.

    Here is a demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com


    patrick
    Participant

    Hi Ivailo,

    Your solution works but only when the rows are added before pageable set to true. How can this be achieved when rows are added dynamically as per demo.

    Regards


    ivailo
    Participant

    Hi patrick.fay,

    You can use the same approach – when the rows are created set pageable:false and immediately revert to pageable:true.
    Here is a demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com


    patrick
    Participant

    Thanks Ivailo

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

You must be logged in to reply to this topic.