Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

determine which item a user has clicked on in a list component

Hi,

Hope you are all well...

I have a list component populate from a database collection. I have gave a name of 'category' and I have worked out by viewing the source at run-time that each item is labelled category_0, category_1 etc. The question is can I determine which item the user has clicked, so that I can write javascript which caters differently for each item.

Thanks,

Terry

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

determine which item a user has clicked on in a list component

Hello Terry,

Yes, you can do it with JavaScript. You can get selected item label value with this code on click event:

code$(this).find("[name=labelName]").text(); /code

where labelName is your label component name.

Terry Gilliver
Posts: 0
Joined: Fri Apr 18, 2014 8:45 pm

determine which item a user has clicked on in a list component

Thanks,

you pointed me in the right direction, infact all I needed was
code
var category = $(this).text();
/code

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

determine which item a user has clicked on in a list component

Terry,

Thank you for your update. Do not hesitate to contact us if you need any further help.

Return to “Issues”