Titanium JIRA Archive
Appcelerator Community (AC)

[AC-823] After deleting section from TableView on ios view stop responding to any action

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2014-08-10T08:00:20.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
LabelsTCSupport, ios
ReporterMarkus
AssigneeMauro Parra-Miranda
Created2014-07-03T10:38:00.000+0000
Updated2016-03-08T07:37:06.000+0000

Description

Problem Description

I have a table View with sections and rows, after the UI has been rendered I wanna delete some sections and rows. But when I call the function deleteRow after I called function deleteSection, the View stopped to be rendered and no other operation is possible on tableview. I can call either deleteSection or deleteRow calling both in a row raise this issue.

Test Code

var win = Ti.UI.createWindow({title:"Click Edit ->"});
var data = [];
var navWin = Titanium.UI.iOS.createNavigationWindow({
   window: win
});
 
 
var tableViewSectionOne     = Ti.UI.createTableViewSection();
var tableViewSectionTwo     = Ti.UI.createTableViewSection();
var tableViewSectionThree   = Ti.UI.createTableViewSection();
var tableViewSectionFour    = Ti.UI.createTableViewSection();
 
 
var tableView = Ti.UI.createTableView({
    backgroundColor:'#FFF',
    rowHeight: 100,
    zIndex:1
});
 
var deleteSection =  Ti.UI.createButton({
    systemButton: Titanium.UI.iPhone.SystemButton.EDIT,
});
 
var dataSectionOne = [
    Ti.UI.createTableViewRow({title:"Click a row to remove",color:'#A00',height:50}),
    Ti.UI.createTableViewRow({title:"Click Editbutton to remove a section and noting will work",color:'#C00',height:50}),
    Ti.UI.createTableViewRow({title:"Row 3",color:'#F00',height:50})
];
 
var dataSectionTwo  =  [
    Ti.UI.createTableViewRow({title:"Row 4",color:'#0A0',height:50}),
    Ti.UI.createTableViewRow({title:"Row 5",color:'#0B0',height:50}),
    Ti.UI.createTableViewRow({title:"Row 6",color:'#0F0',height:50})
];
 
var dataSectionThree  =  [
    Ti.UI.createTableViewRow({title:"Row 7",color:'#00A',height:50}),
    Ti.UI.createTableViewRow({title:"Row 8",color:'#00B',height:50}),
    Ti.UI.createTableViewRow({title:"Row 9",color:'#00F',height:50})
];
 
var dataSectionFour  =  [
    Ti.UI.createTableViewRow({title:"Row 10",color:'#E00',height:50}),
    Ti.UI.createTableViewRow({title:"Row 11",color:'#C00',height:50}),
    Ti.UI.createTableViewRow({title:"Row 12",color:'#B00',height:50})
];
 
 
data.push(tableViewSectionOne);
 
for(var i in dataSectionOne){
    tableViewSectionOne.add(dataSectionOne[i]);
}
 
data.push(tableViewSectionTwo);
 
for(var i in dataSectionTwo){
    tableViewSectionTwo.add(dataSectionTwo[i]);
}
 
 
data.push(tableViewSectionThree);
 
for(var i in dataSectionThree){
    tableViewSectionThree.add(dataSectionThree[i]);
}
 
 
data.push(tableViewSectionFour);
 
for(var i in dataSectionFour){
    tableViewSectionFour.add(dataSectionFour[i]);
}
 
tableView.setData(data);
 
 
deleteSection.addEventListener('click', function(){
    tableView.deleteSection(0);
});
 
win.rightNavButton = deleteSection;
 
tableView.addEventListener('click', function(e){
    tableView.deleteRow(e.source);
});
 
 
win.add(tableView);
 
navWin.open();

Comments

  1. Mostafizur Rahman 2014-07-19

    Hi, We have tested this issue with given test code and it's working good as we expected.

    Test Environment

    Mac OS X 10.9.4 Ti CLI 3.3.0 Titanium SDK: 3.3.0.GA IOS 7.1 Thanks.
  2. Mauro Parra-Miranda 2014-08-10

    Fixed in 3.3.0.GA

JSON Source