[TIMOB-20599] Windows: picker updating data throws unknown exception
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-04-04T16:50:35.000+0000 |
Affected Version/s | Release 5.2.0 |
Fix Version/s | Release 5.4.0 |
Components | Windows |
Labels | picker, qe-5.4.0, windows_phone |
Reporter | Zakhar Zhuravlev |
Assignee | Kota Iguchi |
Created | 2016-03-16T11:44:43.000+0000 |
Updated | 2016-06-13T22:03:16.000+0000 |
Description
It's affected 5.2.0.
How to reproduce:
function onTest() {
var column = picker.columns[0];
_.each(column.rows, function(row) {
column.removeRow(row);
});
var data = [];
data[0]=Ti.UI.createPickerRow({title:'2 Bananas'});
data[1]=Ti.UI.createPickerRow({title:'2 Strawberries'});
data[2]=Ti.UI.createPickerRow({title:'2 Mangos'});
data[3]=Ti.UI.createPickerRow({title:'2 Grapes'});
picker.add(data);
}
//----------------------------
var picker = Ti.UI.createPicker({
top:50
});
var data = [];
data[0]=Ti.UI.createPickerRow({title:'Bananas'});
data[1]=Ti.UI.createPickerRow({title:'Strawberries'});
data[2]=Ti.UI.createPickerRow({title:'Mangos'});
data[3]=Ti.UI.createPickerRow({title:'Grapes'});
picker.add(data);
$.win.add(picker);
$.win.open();
_.delay(onTest, 2000);
Picker
removeRow
and Row/Column editing operation (throughPickerRow
andPickerColum
is not implemented yet. Moving this to 5.4.0.Plain Picker still has some issues. Re-opening this.
https://github.com/appcelerator/titanium_mobile_windows/pull/606
Note:
I think this sample code may be not quite right because
column.removeRow
updatescolumn.rows
while iteration. So everytime_.each
evaluatescolumn.rows
, it may have been changed (which causes undesired result). So make sure to use immutable array:Verified as fixed. Tested on: Microsoft Lumia 640 (8.1) Windows Simulator (8.1) Microsoft Lumia 640 (10) Windows Simulator (10) Windows 10 Pro Studio: 4.7.0.201606100920 Ti SDK: 5.4.0.v20160608165242 Appc NPM: 4.2.7-2 App CLI: 5.4.0-15 Node v4.4.4 *Closing Ticket.*