Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13304] Mobile Web: TableView deleteRow does not work if filled by setting data property to array of sections

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionWon't Fix
Resolution Date2018-04-04T23:57:42.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterAndrey Verbin
AssigneeChris Barber
Created2012-11-23T04:29:45.000+0000
Updated2018-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()

Comments

  1. Pedro Enrique 2013-04-01

    Can't reproduce using Ti SDK 3.0.2.GA
  2. Andrey Verbin 2013-04-01

    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".
  3. Pedro Enrique 2013-04-01

    My mistake, I tested it on iPhone. This is a bug, thanks for reporting it.
  4. Andrey Verbin 2013-04-01

    No problem :), please let me know if you need any more explanations about it.
  5. Eric Merriman 2018-04-04

    Closing as will not fix
  6. Eric Merriman 2018-04-05

    Closing as will not fix

JSON Source