NewTableView - How to support a clickable category

Hi,

Is it possible to define a clickable category in the NewTableViewWidget ?

We need to category concept as it remain on top of the tableview when scrolling, however we cannot have them to be clickable. Any help or suggestion would be appreciated.

thanks

Current tableView implementation does not trigger onRowTouch for categories. A simple workaround is to insert a transparent rectangle with a touch listener into your category rows. Hope this helps.

@ksan, thanks for the proposal, we will give it a try :slight_smile:

@ksan, we try the suggestion to insert a transparent background but unfortunately we cannot move anymore the list when we click on the transparent background. We wanted to try the magic method takeFocus() that exist for the ScrollView, but it is not available in the listview.

Do you have a suggestion ?

thanks

Not knowing what you want to happen when you click the category its a little hard to help. Suggest you take a look at the collapsible categories implementation by @primoz.cerar at the following link : 

http://forums.coronalabs.com/topic/43124-collapsable-nested-tableview-demo/page-2

Look for the code he posted on 25th January. It is a great example for a tableView where the category rows can be clicked to hide the detail rows underneath it. You can peek into how he handles the category row clicks in his sample. 

Hope this helps. All the best. 

Thanks a lot, we will take a look at this.

And by looking at the sample code, we were able to find a solution for our problem.

Current tableView implementation does not trigger onRowTouch for categories. A simple workaround is to insert a transparent rectangle with a touch listener into your category rows. Hope this helps.

@ksan, thanks for the proposal, we will give it a try :slight_smile:

@ksan, we try the suggestion to insert a transparent background but unfortunately we cannot move anymore the list when we click on the transparent background. We wanted to try the magic method takeFocus() that exist for the ScrollView, but it is not available in the listview.

Do you have a suggestion ?

thanks

Not knowing what you want to happen when you click the category its a little hard to help. Suggest you take a look at the collapsible categories implementation by @primoz.cerar at the following link : 

http://forums.coronalabs.com/topic/43124-collapsable-nested-tableview-demo/page-2

Look for the code he posted on 25th January. It is a great example for a tableView where the category rows can be clicked to hide the detail rows underneath it. You can peek into how he handles the category row clicks in his sample. 

Hope this helps. All the best. 

Thanks a lot, we will take a look at this.

And by looking at the sample code, we were able to find a solution for our problem.