Adam Garbinski
Posts: 0
Joined: Sat Sep 28, 2013 5:33 pm

How to assign html attribute to select component during mapping?

Hi Katya
It works now, but not exactly the way I wanted. After clicking It loops through all items on the list and displays them one after another. I suppose you wanted it to work that way but I need just one item - the one that was clicked. Can we achieve this with that code?
Cheers,
Adam

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to assign html attribute to select component during mapping?

Hi Adam,

Here is what you need:prealert($("[rerender=Subgroup][data-group]").find(":selected").attr('data-group'));/pre

Adam Garbinski
Posts: 0
Joined: Sat Sep 28, 2013 5:33 pm

How to assign html attribute to select component during mapping?

Hi Katya,
I get "undefined" again :-(
Can you please doublecheck it?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to assign html attribute to select component during mapping?

Hello! Please try this way prealert($("[rerender=Subgroup]:selected").attr('data-group'));/pre

Adam Garbinski
Posts: 0
Joined: Sat Sep 28, 2013 5:33 pm

How to assign html attribute to select component during mapping?

Respect to the BEST SUPPORT IN THE WORLD :-)

It is working now!

Thank you. Hope it will be helpful for anyone trying to do the same.

Cheers!

Return to “Issues”