After destroying and reinitiating the datatable , the selection and deselection not working
After destroying and reinitiating the datatable , the selection and deselection not working

I am initiating the data-table through the function in javascript. I am calling the function in change events of the controls. But after destroying and re-initiating the data-table, the row can be selected but previous selection of the row still there. How can make it one row selection at a time. Please can you advise me where is the error in my code to select the row of the data-table. I have attached the code in txt file
With Many Thanks
Pol
This discussion has been closed.
Answers
One option would be to use the Select Extension.
Currently you are using jQuery to select and deselect the rows, for example:
$(this).addClass('selected');
. Datatables has no knowledge of this so you will need to handle this yourself.You can try something like the answer in this SO thread inside your
GetBreakDownLog()
function.Kevin
I given the suggested code still more than one row is being selected after calling the function GetBreakDownLog() seconed time. But when I call first time it is working fine . But after the change event of the month or year , the more than one is selected.
I give the code inside GetBreakDownlog as
$('#BreakDownLog tr').removeClass("selected");
It would be very much appreciated if you can give suggested code
Hi @polachan ,
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