Selecting Nested Table Checkboxes

Selecting Nested Table Checkboxes

Sageis1Sageis1 Posts: 53Questions: 9Answers: 0

Hello,

Go to the test case first, cause the futher description is kinda hard to understand, without knowing context, thanks.

What I am trying to achieve is :
- A Select All Button to Select All Inner Table Check Boxes, as well as all parent rows of inner tables
- A Row by Row Selection for parent rows to select all inner checkbox of table in that specific row
- This ties into the previous one, when all rows in an inner table have been selected, the parent row for that table is also checked, otherwise its not

I have created the test case: Test Case

From the list above, if the header check box is selected, then everything else is also selected, including inner tables.
If a Parent Row is checked, then all inner table rows will also be checked for that single row.
When all Rows for a specific inner table is checked, then the parent row the table is nested in, will also be checked, other wise it's not.

Thanks

This question has an accepted answers - jump to answer

Answers

  • Sageis1Sageis1 Posts: 53Questions: 9Answers: 0

    Also I did notice just now, when I check any one of the inner table check boxes, and open and close the row, it unchecks the inner table checkbox i originally checked, not sure what to do about that.

  • Sageis1Sageis1 Posts: 53Questions: 9Answers: 0

    Anybody have a solution?

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin
    Answer ✓

    This isn't something I've tried to do before I'm afraid, as DataTables doesn't have a true tree view mode. However, it will be possible and what I think you should do is have a data property (called checked or something like that) for each row on the parent and child table. It is that which would be toggled and the table would be updated (invalidated) to reflect the state.

    Or another way of putting it - don't attempt to store the checked state in the DOM (since when the child row is hidden, the child table is removed). Instead store it in the data object for each row.

    Allan

  • Sageis1Sageis1 Posts: 53Questions: 9Answers: 0

    Okay thanks @allan, if you wouldnt mind, could you pls help with the test case, you dont have to do all rows, just one row is fine, ill carry it across all other rows, i just dont know how to approach this as its nested. Thanks again. Here is the test case Test Case

  • allanallan Posts: 63,678Questions: 1Answers: 10,497 Site admin

    Sure, that would be something that would fall under our paid support options.

    Allan

Sign In or Register to comment.