Selected Row not getting removed on a reload of table with C# partial view

Selected Row not getting removed on a reload of table with C# partial view

chrisbochrisbo Posts: 5Questions: 3Answers: 0

I have a multi-select Datatable that is using the JQuery contextmenu API in an MVC web application. In the Datatable on my partial view I select a row then right-click to run an action on the selected row in my Controller which updates the database. If successful the partial view gets reloaded with the Datatable and with the new data set. This can be run multiple times.

However, after running the above process once, every subsequent attempt to right click and run an action on a different row in the Datatable returned in the partial view returns the ID and information of the first row that was selected the first time even though new ones have been selected. I am not sure why this value seems to be "sticking" even though I am reloading the Datatable.

Is there something I need to be doing before the Datatable loads from a refresh from a partial view to clear the original Datatable? Any help in resolving this issue would be appreciated. If you need more details let me know.

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.