Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14917] iOS: PIcker doesn't update when removeRows() is called.

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsiOS
Labelsios5, reprod
ReporterHieu Pham
AssigneeUnknown
Created2013-08-19T22:41:56.000+0000
Updated2018-02-28T20:04:18.000+0000

Description

Steps to reproduce: 1. run this code
var win = Ti.UI.createWindow({
  layout: 'vertical'
});
 
var picker = Ti.UI.createPicker({
  useSpinner: true
});
 
var fruit = [ 'Bananas', 'Strawberries', 'Mangos', 'Grapes' ];
var column1 = Ti.UI.createPickerColumn();
 
for(var i=0, ilen=fruit.length; i<ilen; i++){
  var row = Ti.UI.createPickerRow({title: fruit[i]});
  column1.addRow(row);
}
 
picker.add([column1]);
win.add(picker);
win.open();
 
var btn = Ti.UI.createButton({
    title: "Remove columns"
});
btn.addEventListener('click', function() {
    var _col = picker.columns[0];
    var len = _col.rowCount;
    for(var x = len-1; x >= 0; x-- ){
        var _row = _col.rows[x];
        _col.removeRow(_row);
    }
});
win.add(btn);
2. Click on "Remove Columns" button. Expected Behavior: all rows should be removed from picker (i.e should see empty picker) Actual Behavior: all rows are still visible.

Comments

  1. Priya Agarwal 2013-12-06

    Tested Environment: Appcelerator Studio: 3.2.0.201312042306 SDK:3.2.0.v20131205165947 alloy: 1.3.0-beta acs: 1.0.9 npm: 1.3.2 titanium: 3.2.0-beta titanium-code-processor: 1.1.0-beta Xcode:5.0.2 OS: Mac OSX 10.9 Device: iphone5(V7.0.4) Issue still reproducible. On clicking "Remove Columns" Picker does not get updated. Then on Scrolling the picker 2 to 3 times the rows gets deleted and picker gets empty.
  2. Shameer Jan 2014-08-13

    Issue reproduces Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0.GA iOS SDK: 7.1 iOS iPhone Simulator: 7.1
  3. Lee Morris 2017-05-24

    I have been able to reproduce this issue with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.9.0.201705021158 Ti SDK 6.1.0.v20170519131839 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.7.0_80

JSON Source