Row Selection issue
Row Selection issue
Hello, this is my first question on this forum. Please advise if I haven't followed the guidelines when posting a question and I will make the appropriate fix.
Link to test case:
Debugger code (debug.datatables.net):
I added this to the Test case and tried to upload config but the link to the code presented a 404.
Error messages shown:
Description of problem:
So just for some context, I am building a bioinformatic web app within python/flask, I dont have extensive knowledge using JS and this is the first time I have been experimenting with DataTables so bare with me.
I am trying to build an array of accession numbers (GSMxxxxxxx) based on the rows in the table that are currently highlighted. I have got to a point where I have tried different jquery methods in place of the original code, but I cant seem to get it the behave how I want it to.
There are two immediate issues I am trying to solve:
The first relates to the multiple arrays that are generated every time I select a row, it works in a sense that it will add another accession number every time I select another row, but it also keeps the previous arrays. I want try to add accession numbers to the same array and not build a new one every time. I hope that makes sense, I have provided an image below of the array I want to remain (bracketed in red), and the other I dont (not bracketed in red).
The other issue is when I deselect a row that I dont want to be in the array anymore (e.g. I miss click a row and want to un-highlight it), the entire array gets removed and not just the accession number that is contained in the row that I deselected.
I know how it could be done theoretically, I just dont have the requisite knowledge in JS to apply the logic into language - If the array only contained accession numbers that are from rows that are currently highlighted in the table, rather than on selection, I think that would solve my problem. Although I have tried using words such as "highlight(ed)" in place of "select(ed)" to no avail.
Please let me know if there any issues with the test case or how I have constructed my question and I will try to help.
This question has an accepted answers - jump to answer