[TIMOB-13304] Mobile Web: TableView deleteRow does not work if filled by setting data property to array of sections
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2018-04-04T23:57:42.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | n/a |
Reporter | Andrey Verbin |
Assignee | Chris Barber |
Created | 2012-11-23T04:29:45.000+0000 |
Updated | 2018-04-05T00:00:04.000+0000 |
Description
*Test case*
var wnd = Ti.UI.createWindow()
Ti.UI.backgroundColor = "#FFFFFF"
//Problems:
//1. second section appear differently than first and third
//2. deleteRow(3) removes row number 6
function tableViewBug() {
var table = Ti.UI.createTableView()
var sections = []
for (var i = 0; i < 3; ++i) {
var section = Ti.UI.createTableViewSection()
for (var j = 0; j < 3; ++j) {
var row = Ti.UI.createTableViewRow()
var label = Ti.UI.createLabel({
text : "section:" + i + " row:" + j
})
row.add(label)
section.add(row)
}
sections.push(section)
}
table.data = sections
wnd.add(table)
setTimeout(function() {
table.deleteRow(3)
}, 3000)
}
tableViewBug()
wnd.open()
Can't reproduce using Ti SDK 3.0.2.GA
Hi Pedro, I can definitely reproduce this with 3.0.4.GA with iPhone Mobile Safari, Chrome and Safari browsers. I've also posted [pull request](https://github.com/appcelerator/titanium_mobile/pull/3470) with partial fix for this problem. Also you may notice two things running above code: 1. When I do table.deleteRow(3) "Section 2: row 3" row being deleted, not "Section 0: row 2". 2. There are no separators in "section 1" rows. Thu bug is [here](https://github.com/appcelerator/titanium_mobile/blob/master/mobileweb/titanium/Ti/UI/TableView.js#L284). "sections" array there has "sections" and "separators". But for statement iterate it as if it had only "sections".
My mistake, I tested it on iPhone. This is a bug, thanks for reporting it.
No problem :), please let me know if you need any more explanations about it.
Closing as will not fix
Closing as will not fix