I have a table consisting of rows. Each row has id, data-parent attribute, and a virtual level option stored in data(). Top level rows don't have nor parent nor level attribute. I need to find last child of a node, like ex:
<tr id="83" class=""></tr>
<tr id="91" class="successor" data-parent="83"></tr>
<tr id="93" class="successor" data-parent="91"></tr>
<tr id="92" class="successor" data-parent="91"></tr>
<tr id="94" class="successor" data-parent="92"></tr>
<tr id="133" class="successor" data-parent="83"></tr>
<tr id="134" class="successor rowselected" data-parent="83"></tr>
This looks like
I need to find if row 1.1.1.1 is the last one for 1.1 . How to do it? tried to use nextAll or prevAll selectors and filtering it by data-parent and level... but no luck. Thanks.
Struggling whole day led me to this solution : finding the top node for the row on the same level with dragged row and checking if the element was last before dragged element.