Hello,
I try to assign html attribute "data-something" to the option of select component. I need this because it seems the only way to get text label of selected option and store it in local storage for further use in my project. Simple way to achieve this is described here http://jsfiddle.net/TLGY7/12/ but I need to implement this approach during mapping, since I populate my select component from REST service. You can see my mapping on the screen below.
So the question is how can I do it? I tried many approaches with various selectors but I still get "unassigned" response when I check that attribute value.
My only success was to assign that attribute to all input elements by this Javascript:
$(":input").attr("data-group", value.SubGroup);
which destroys all previous assingments and lefts only last value readed during mapping process, but at least gives me information that it is possible, but I need to use different selector.
So I would greatly appreciate your guidance on that.