Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3306] TiAPI: Ti.UI.TableViewRow hide()/show() doesn't work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2016-09-14T08:51:30.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sn/a
ComponentsiOS
Labelsapi
Reporterskypanther
AssigneeIngo Muschenetz
Created2011-04-15T03:41:48.000+0000
Updated2017-03-23T21:50:06.000+0000

Description

I need to be able to hide/show table view rows. The docs say hide() and show() exist, but they have no effect. Setting height=0 or visible=false (both in the docs) also do not work. Alternatively, add support for deleteRow(tblRowObjectReference) and insertRowAfter(tblObjectReference) rather than by index number. I need to be able to hide/show the same table row based on user's other selections. User selects a product, related options in a table need to hide/show as a result. But if they switch back, I need those original selections back in the same order. Using indexes gets very complex and all my attempts just result in exceptions/crashes. Using Ti SDK 1.6.0 tested on both iOS 4.2 simulator and Android 2.1 SDK emulator.

Comments

  1. Junaid Younus 2012-09-07

    Tested on a Samsung Galaxy S2 and on the iOS simulator using TiSDK 2.2.0v20120906100912, issue still valid. insertRowAfter/inserRowBefore have both been implemented, according to the docs: http://docs.appcelerator.com/titanium/2.1/index.html#!/api/Titanium.UI.TableView-method-insertRowAfter I tested tableViewRow.hide() and it doesn't work on iOS and Android, nothing happens. tableViewRow.visible = false also doesn't work on iOS but hides the label on Android. Test code:
       var win = Ti.UI.createWindow({backgroundColor: 'white'});
       
       var tableData = [Ti.UI.createTableViewRow({ title: 'Apples' }),
                        Ti.UI.createTableViewRow({ title: 'Bananas' }),
                        Ti.UI.createTableViewRow({ title: 'Carrots' }),
                        Ti.UI.createTableViewRow({ title: 'Potatoes' })];
       
       var table = Ti.UI.createTableView({
           data: tableData
       });
       
       tableData[2].visible = false;
       tableData[1].hide();
       
       win.add(table);
       win.open();
       
  2. Wolfgang Schmidetzki 2013-01-09

    I also miss this this "feature". Setting visible=false on a tableviewrow does have no effect. It should.
  3. sourabh kaley 2013-07-02

    Any update here?? Can anyone suggest alternate solution pls
  4. Matej 2013-09-12

    This is not normal. More than two years old bug. Again lost time with workaround.
  5. Matthew Delmarter 2015-12-07

    Searching for a solution to this issue shows so many Q&A tickets open and comments from frustrated users. Really don't understand why this hasn't been given higher priority...
  6. Brenton House 2016-08-03

    I know this is a really old ticket, but is there any chance this is going to be looked at? Thanks!
  7. Hans Knöchel 2016-09-14

    The Ti.UI.TableView API wraps the UITableView on iOS and the android.widget.ListView on Android. Both API's don't work with hiding and showing rows. Instead, they offer an API that we also use to hide and show API's: - To hide a row, use [deleteRow](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-method-deleteRow) - To show a row, use [deleteRowBefore](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-method-insertRowBefore) or [insertRowAfter](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-method-insertRowAfter) That's the proper way to go. The main reason for that (nativ behavior) is that the section- and item-indexes need to stay in sync. By using the above methods, this is guaranteed. Thanks!
  8. Lee Morris 2017-03-23

    Closing ticket with reference to the above comment.

JSON Source