-1

I’ve created a nested list with following structure:

enter image description here

Now I’m performing different-2 task on these items using onNestedlistLeafItemTap as follows:

if (record.data.text === 'Shop Item')  // Item-1 Shop Item
{
// some line of code
}

 if (record.data.text === 'RIM Item')  // Item-1 RIM Item
{
// some line of code
}

 if (record.data.text === 'My Item')  // Item2- My Item
{
// some line of code
}

But problem is here: How can I distinguish which Shop Item is tapped that means Item1-> Shop Item is tapped or Item2-> Shop Item is tapped because in both case only first condition is called. Let me know how can resolved this problem.

Any help is appreciating!!

Arun Singh
  • 263
  • 8
  • 19

1 Answers1

0

You should be able to use parentNode on the record:

if (record.data.text == 'Shop Item' && record.parentNode.data.text == 'Item2')
{
    //some code
}
kevhender
  • 4,285
  • 1
  • 13
  • 16