Parent Child Checkbox Checked Order - Follow Up

Tags: #<Tag:0x00007efc7296daa0> #<Tag:0x00007efc7296d960>

Would you guys help me in updating this
handsontable (forked) - StackBlitz

To do the following:

Add button that if clicked then it will console log the child rows that has their checkbox checked

However, really my main hope is to find if more than child rows were selected then I would like to know in what order was these checkboxes select

Did the user checked the checkbox like the following:

Parnet1.Child 1 [Checked]
Parnet1.Child 2 [Checked]
Parnet1.Child 3 [Checked]
Parnet2.Child 1 [Checked]

or

Parnet1.Child 3 [Checked]
Parnet1.Child 1 [Checked]
Parnet1.Child 2 [Checked]
Parnet2.Child 4 [Checked]
Parnet2.Child 2 [Checked]


I know the above would be hard to achieve without adding something that let the user let us know his/her order of checking the boxes

please help me to achieve this

Hi @noajm

I checked your implementation, and it seems to to me that in general your requirements are already met, or maybe I misunderstood something. When I modified your log a bit:

console.log('Parent Row Index:', parentIndexes, 'Checked Child Rows:', 'Child index:', childIndex, 'Checked:', child.agreed);

I get the following results:

Parent Row Index: Array(4) Checked Child Rows: Child index: 1 Checked: true
Parent Row Index: Array(4) Checked Child Rows: Child index: 4 Checked: true
Parent Row Index: Array(4) Checked Child Rows: Child index: 3 Checked: true
Parent Row Index: Array(4) Checked Child Rows: Child index: 4 Checked: true

I think it’s a matter of modifying the parent row indexes getter to get only one parent instead of the array. Additionally, the checkboxes will always be logged in order of checking them anyway.

sorry I might mis explain myself

for example, if I checked box like the following:

then

the output will be like:
{title: “Drones”, orderno: “40004”, artist: “Muse”, }
{title: “.5: The Gray Chapter”, orderno: “40004”, artist: “Slipknot” }

However I would like it to be like:
{title: “.5: The Gray Chapter”, orderno: “40004”, artist: “Slipknot” }
{title: “Drones”, orderno: “40004”, artist: “Muse”, }

since I clicked Slipknot first and then Muse

@noajm

Thank you for the clarification. I checked it again, and it seems that you can get the “correct” selecting order if you select the checkboxes from top to bottom of the table. The other way round it’s in “reversed” order. We don’t provide any specific API that would allows to easily check the selection order.

At that point it’s a custom implementation and because of that I have to ask you for your license ID so I can check your current support plan. Please send it to support@handsontable.com

Close This Ticket, Please