This project is read-only.

Find Parent section of newly created section

Sep 26, 2012 at 2:37 PM


  I want to find parent section of newly created section without submitting treeView. In my scenario I added new section and near to section I have one icon on click of that i want to find it's parent section.

I am not find any criteria to pass to Jquery selector so that I can find it's paret

Please help me out.




Sep 26, 2012 at 5:27 PM

From within the click handler:

$(this).closest('ul').closest('li') gives the root of the father. First find the container of all children that id a ul snd then the father root that is a li

Sep 27, 2012 at 10:01 AM

Hi Frank,

 Thanks for ur reply . But it's not working. this statement $(this).closest('ul').closest('li') returns object of length 1.

Please suggest is there any other way .



Sep 27, 2012 at 2:20 PM

The parent section is just one...if I have understood what you mean. Each node root is a li html node and the above statement finds the father of the node where the button was clicked that is just one.

Sep 27, 2012 at 4:18 PM

Hi Frank,

Thanks for your reply. I did mistake while selecting elememt for finding parent. But thanks for your suggestion.