Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Tableview removing multiple rows
Started by kliff.simon Nov 21 2013 03:12 PM

3 replies to this topic
widgets tableview
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

kliff.simon

[GLOBAL: userInfoPane.html]
kliff.simon
  • Observer

  • 3 posts
  • Corona SDK

So my app has a tableview with a list of object with an edit button that would allow to the selection of multiple rows for deletion. Similar to emails on ios where you can select however emails to delete at once and the tableview re-adjusts correctly to how many rows were deleted.

 

Deleting one works just fine as should be. Problem is when trying to delete multiple using tableView:deleteRow(index) on the rows to be deleted.. that all rows below get moved up only one rows worth height. so if I tried to delete 2 rows, everything would shift one up and there would be one row that is completely empty.

 

Has anyone run into this problem or know of a work around to this?



[TOPIC: post.html]
#2

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

I only delete 1 row at a time so I can't confirm. But was it working prior to Graphics 2? If so it could be connected to problem #1 here perhaps: http://forums.coronalabs.com/topic/41623-2-possible-problems-with-tableview-in-g2/

That is that the other move up transitions are canceled when the table moves up for the first deleted row.



[TOPIC: post.html]
#3

kliff.simon

[GLOBAL: userInfoPane.html]
kliff.simon
  • Observer

  • 3 posts
  • Corona SDK

I have not worked with tableviews prior to Graphics 2 so I cannot say.

 

But it does seem like that might be the issue. If I put in a delay in between each row deletion, it works, but obviously just way slower



[TOPIC: post.html]
#4

ksan

[GLOBAL: userInfoPane.html]
ksan
  • Corona Geek

  • 2,795 posts
  • Corona SDK

Just ran into this issue. Seems like a bug. To duplicate simply open ListView2 sample and paste the following at the end of main.lua

 

list:deleteRow(2)
list:deleteRow(3)
list:deleteRow(4)
list:deleteRow(5)
 
You will end up with the tableView looking like the screenshot. This is a serious bug if you ever need to remove more than one row. Bug reported ... #29772

Attached Files




[topic_controls]
[/topic_controls]