well I have this code in a view
<Picker id="picker1" selectionIndicator="true" class="picker">
<!-- Picker shorthand notation -->
<Column id="column1" class="column">
<Row title="option1" />
<Row title="option2" />
<Row title="option3" />
</Column>
</Picker>
and I have been trying to change the rows on the controller, since I receive different options from the server, lets say for example: ( option4, option5, option6 )
I tried adding a row to the picker like this:
$.column1.addRow(Ti.UI.createPickerRow({title:'option4'}));
and had no success too, looking through the forums on appcelerator it wasn't possible before titanium SDK 5.1.0 GA to dynamically update the picker, but on another topic I've read that it is possible to do it but you have to reload the picker, so I tried it, but no success
var picker = $.picker1;
var column = $.column1;
column.addRow(Ti.UI.createPickerRow({title:'option4'}));
picker.reloadColumn(column);
how should be the right way to do it? adding a row and removing others, that is my question.
I am testing on an iphone(9+) and android(5+), using the Titanium SDK 5.1.2GA.
Solved, it was just a mistype, sorry, but you need to reload the column, or else it will not work.
var picker = $.picker1;
var column = $.column1;
column.addRow(Ti.UI.createPickerRow({title:'option4'}));
picker.reloadColumn(column);