M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Select component

hi,

Okie. I was surprised at the result cos my mapping updates a Select component with 7 items. But I found that this statement returns 8

alert(options.length.toString());

Strange but true :)
Anyway thanks...I am iterating through the items and only picking up values that have the id and text. Just my way of confirming that there are no invalid values :)

Thanks & Cheers,
M&M

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Select component

hi,

I think I was correct in saying that even though there are say 6 items in the Select component, when you iterate it will give you 6 + 1

This code of yours will also do the same ")
var values = [];
var options = Appery("mobileselectmenu_12").find("option");
for(var i = 0; i < options.length; i++){
var option = jQuery(options);
values.push({value: option.val(), view: option.text()});
}
//show array in the browser console
console.log(values);

Thanks,
M&M

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Select component

anyways i sorted it out.

thanks
MnM

Return to “Issues”