Dear Appery,
i have a list within a list:
the child list (blue) is invisible to the user, how can i read the labels text in the child list when clicking on the parent (green) list?
Many thanks in advance!
Best,
R.
Hi Ram,
Add the following click event handler for a parent item:prevar list = $(this).find("[data-role=listview] li");
var arr = [];
list.each(function(e){
arr.push($(list[e]).text());
});/preThen you get an array 'arr' containing texts of a child list.
since i had to change the nested list to a grid component , what is the correct code instead of the following one published by Katya?
precode
var list = $(this).find("[data-role=listview] li");
var arr = [];
list.each(function(e){
arr.push($(list[e]).text());
});
/code/pre
Hi Ram, sorry but it's not very clear what you want to do.
Hi Illya,
thank you for your reply.
i had a list within a list, the child list held an array that was mapped into labels; the code that Katya published loop though all the labels once the parent list item was clicked and filled the variant "arr" with all the text the labels held.
since then i had to replace the child list to a grid, now the grid holds the array that is mapped into labels, my question is what is the correct code to retrieve the text of the labels from the grid once the parent list item is clicked?
got it, thx anyways.
code
var list = $(this).find("tbody");
/code