[AC-2613] picker .setColumns() doesn't update UI
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-09-24T14:56:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | ios, picker, setColumns |
Reporter | Jimmy Forrester-Fellowes |
Assignee | Shak Hossain |
Created | 2012-09-24T14:49:25.000+0000 |
Updated | 2016-03-08T07:41:42.000+0000 |
Description
**Not a bug: turns out thats the expected behavior - please close ticket**
Using the picker on iOS simulator, if you use setColumns() in a callback/timeout then it doesn't refresh the UI of the picker. See the example below.
What you should see:
You should see "one", "two", "three" appear after 2.5 seconds and "four", "five", "six" appear after 5 seconds.
What you see:
Nothing until 5 seconds has passed (when the picker.add() is called, then you see all the rows: "one", "two", "three", "four", "five", "six".
var picker = Ti.UI.createPicker({
type:Ti.UI.PICKER_TYPE_PLAIN,
columns: [Ti.UI.createPickerColumn()],
selectionIndicator: true
});
setTimeout(function () {
var col = Ti.UI.createPickerColumn();
col.addRow(Ti.UI.createPickerRow({title:'one'});
col.addRow(Ti.UI.createPickerRow({title:'two'});
col.addRow(Ti.UI.createPickerRow({title:'three'});
picker.setColumns([col]);
}, 2500);
setTimeout(function () {
var rows = [];
rows.push(Ti.UI.createPickerRow({title:'four'});
rows.push(Ti.UI.createPickerRow({title:'five'});
rows.push(Ti.UI.createPickerRow({title:'six'});
picker.add(rows);
}, 5000);
Not a bug: turns out thats the expected behavior - please close ticket
Talked with Jimmy on IRC, we sorted out that he needs to use reloadColumn instead