Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2613] picker .setColumns() doesn't update UI

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2012-09-24T14:56:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsios, picker, setColumns
ReporterJimmy Forrester-Fellowes
AssigneeShak Hossain
Created2012-09-24T14:49:25.000+0000
Updated2016-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);		


Comments

  1. Jimmy Forrester-Fellowes 2012-09-24

    Not a bug: turns out thats the expected behavior - please close ticket
  2. Shannon Hicks 2012-09-24

    Talked with Jimmy on IRC, we sorted out that he needs to use reloadColumn instead

JSON Source