how to Keep selected rows when I go to another page or refresh page

how to Keep selected rows when I go to another page or refresh page

farhadtablefarhadtable Posts: 47Questions: 27Answers: 1
edited May 2017 in Select

can i keep selected rows when i go to another page and add selected row to up data-table rows for next page ?

because i want to see selected row in all time ...

This question has an accepted answers - jump to answer

Answers

  • bindridbindrid Posts: 730Questions: 0Answers: 119
    Answer ✓

    Part one: use the select row and unselect row events to grab the data associated with all of the selected rows and store them in sessionStorage in the client.

    Part two: add logic to add pull out the data from sessionStorage and append it to the data on the new page as part of the data table initialization and reselect them.

    This assumes that the data sets have the same structure from page to page. I would also want to make sure each data structure has a unique identifier to avoid duplicate rows.

    If the same dataset are the same from page to page, all you would have to do is store the array of unique identifiers.

This discussion has been closed.