B4i Library [class] IndexedTable

This class adds an "index" to a TableView:


B4A implementation of this class: https://www.b4x.com/android/forum/threads/indexedtable.60300/

Note that the B4A implementation uses a Map as a small index. This improves the performance if there are many items. It should be simple to port it to this implementation.
 

Attachments

  • IndexedTable.zip
    5.7 KB · Views: 80
Last edited:

sorex

Expert
Licensed User
Longtime User
nice, Erel.

I just wondered what would happen if you add 1 more character in that list?
 

John Woodsmall

Active Member
Licensed User
Longtime User
ok..got this work...great
But...
can i add to the text file and then at a later date
delete from the text file.
i mean to have a list of birth dates that are added programmaticly
I would want to access them and maybe delete one or two later.
Like a text database.

can i do this with this nice new text index?
(i do all of this now with an oracle database on-line)
but i would like to have a local database on the phone.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I just wondered what would happen if you add 1 more character in that list?
You can add characters. Go over the code and see how it handled the characters.

can i add to the text file and then at a later date
delete from the text file.
Not sure that I understand the question. It is better to post it in another thread.
 

Mahares

Expert
Licensed User
Longtime User
This post should have been for B4A not B4i. Please move to B4A
On a small device the alphabetic index is very crowded as shown in this picture
upload_2015-11-26_9-35-58.png
I changed the pnIndex from a panel to a scrollview in the IndexedTable class so I can expand the spacing between the letters, but could not get the touch event of the scrollview to move the listview to the corresponding letter as seen below.
upload_2015-11-26_9-42-56.png

Any hints on how to get the touch event to work and move the listview to the corresponding letter touched will be highly appreciated.
Thank you
 
Last edited:

RVP

Active Member
Licensed User
Longtime User
Indexed Table is based on TableView which you added support to for Action Buttons. However it is not possible to pass the ActionButtonClicked event back to the main program as it has 3 parameters and there is no CallSub4 option.

For now I have done it like this:

B4X:
Private Sub tv_ActionButtonClicked (SectionIndex As Int, Cell As TableCell,text As String) ' added Custom RVP
    Dim calllist As List
    calllist.Initialize
    calllist.Add(Cell)
    calllist.Add(text)
    CallSub3(mTarget, mEventName & "_ActionButtonClicked", SectionIndex, calllist)
End Sub

But it would be nice to have it using the actual parameters
 
Top