Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Alphabetic index for TableView
Started by 3beeepb Nov 15 2017 04:23 AM

3 replies to this topic
[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

3beeepb

[GLOBAL: userInfoPane.html]
3beeepb
  • Observer

  • 5 posts
  • Corona SDK

Hi

 

Help me please, is there a solution for the alphabetic index for TableView?

Like on a picture

 

Attached File  123.png   15.39KB   0 downloads

 

 

 

Thanks!



[TOPIC: post.html]
#2

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,073 posts
  • Corona SDK

No, but it's not actually hard to build. Just put a display group with the letters over the top of the table view.

 

What is harder is making the section separators bump to the top as the user scrolls. I've still not found a smooth, satisfactory solution for that in Corona; It's not a built-in feature of the TableView.



[TOPIC: post.html]
#3

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,960 posts
  • Corona SDK

Not built in, but I believe I implemented this before.

 

Loop through all your rows of data, checking the first letter of the entry against the first letter of the previous entry. If it's different, add a category header for that letter, and store the index of the row in a table alongside the letter. When the user taps on the letters on the right hand side, use the ID of the letter pressed to lookup the row in the index table, and use :scrollToIndex to go to that row.



[TOPIC: post.html]
#4

3beeepb

[GLOBAL: userInfoPane.html]
3beeepb
  • Observer

  • 5 posts
  • Corona SDK

No, but it's not actually hard to build. Just put a display group with the letters over the top of the table view.

 

What is harder is making the section separators bump to the top as the user scrolls. I've still not found a smooth, satisfactory solution for that in Corona; It's not a built-in feature of the TableView.

 

 

Not built in, but I believe I implemented this before.

 

Loop through all your rows of data, checking the first letter of the entry against the first letter of the previous entry. If it's different, add a category header for that letter, and store the index of the row in a table alongside the letter. When the user taps on the letters on the right hand side, use the ID of the letter pressed to lookup the row in the index table, and use :scrollToIndex to go to that row.

 

Thanks guys!




[topic_controls]
[/topic_controls]