0
votes

I'm building an application with appcelerator studio.

In my Window, I have a "picker" with some element like this:

<Picker id="pickerUm" selectionIndicator="true" class="picker_modal" >
    <PickerColumn id="column1">
    <PickerRow title="/mL"/>
    <PickerRow title="P'"/>
    <PickerRow title="/dL"/>
    <PickerRow title="/g"/>
    </PickerColumn>
</Picker>

Now I want that throught an event I can change the selected item from this Picker element.

For examle I want that the selected element is "/dL".

How can I do it?

1

1 Answers

0
votes
var index = ["/mL","P'","/dL","/g"].indexOf(value);
if (index > -1) {
    $.pickerUm.setSelectedRow(0, index, true);
}

http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Picker-method-setSelectedRow