Rows getting deselected during ajax.reload (in-flight?)

Rows getting deselected during ajax.reload (in-flight?)

ErsanErsan Posts: 1Questions: 1Answers: 0

I have a table with the select extension that runs ajax.reload every 2 seconds - I want to maintain which rows are selected through the reload so I'm using rowId.

Many many times when I select a different row, or deselect a row it will "undo" my selection and select the previously selected row(s) instead on the next reload. When this happens select and deselect events are not fired. My hunch is that this happens when I select a row while ajax.reload is being run (in-flight).

The AJAX data takes probably around 300-400ms to serve. I figured maybe I could abort the AJAX request on row selection, like this:
table.on('select', function(e, dt, type, indexes) { if(type === "row") { this.settings()[0].jqXHR.abort(); } }
But it doesn't seem to make a difference. Is this expected behavior or have I done something wrong? Is there anything I can do about it?

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.