Wrong row ID being returned in 'select' event

Wrong row ID being returned in 'select' event

ayzayz Posts: 63Questions: 23Answers: 1
edited April 2018 in Free community support

As a consequence of this, I am saving values of a datepicker field in session storage using the row id as key. When the page is returned to, rowcallback checks there's a value for the key in the sessionstorage and if there is, calls select() to ensure it appears selected.

This is failing. For some reason, if go and select something with DT_RowId = 'row_2500'. This works fine, until i navigate away and come back to the page. Now depending on the position of the selected row on the newly displayed page (say its the first, this is given value of 1,) it tries to retrieve sessionstorage for key 'row_1' within the 'select' event (using dt.row( indexes ).id()). This of course does not exist soo I'm unable to achieve the desired effect of displaying what's previously selected correctly. Every item I select suffers same fate of being retrieved with a cardinal number relative to position in the page whilst all other rows still have their original ids.

I've been on this for a couple of frustrating days. Is there an easier solution?

Please note: I've used console.log to display row.data() within rowcallback as well as the select event: for the above example these show 'row_2500' and 'row_1' respectively for the very same row.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.