B4A Library [Class] Flexible Table

klaus

Expert
Licensed User
Longtime User
Can I have a table with no header row?
In version 1.34, in the first post, I added a HeaderHeight property.
Setting it to '0' removes the Header.
If a table is created with Addrows, Table RowColor2 cannot be changed. It works loading CSV and DB.
I amended the RowColor problem.
 

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you, Klaus.

This extended table class is a great contribution to the community. VERY powerful tool! Thank you.

Best regards.

Sandy
 

Kapelis

Member
Licensed User
Longtime User
Hello friends, I'm trying to build some kind of calendar with this class and I would like to highlight the days of Saturday and Sunday with a different color, is it possible? I have already changed the color of rows by changing the cRowColor1 and cRowColor2 in the class.
I tried this code but it doesn't work:
B4X:
Dim GiornoL2 As Long ' (vedi "GiornoL")

For x = 1 To Table1.Size-1
    GiornoL2 = DateTime.GetDayOfWeek(Table1.GetValue(4, x))
' Table1.GetValue(4, x) = date in Ticks
    If GiornoL2 =1 Then
        'Table1.JumpToRowAndSelect(x, 4)
        'Table1.SelectedRowColor=Colors.Magenta
        Table1.RowColor1=Colors.Green
        Table1.RowColor2=Colors.Green
    End If
   
Next

Thank you all
 

klaus

Expert
Licensed User
Longtime User
It is not possible to set different colors to individual cells, nor is it possible to define different colors for columns.
I think you could easily achieve this with a standard ScrollView or with the CustomListview class.
 

Kapelis

Member
Licensed User
Longtime User
It is not possible to set different colors to individual cells, nor is it possible to define different colors for columns.
I think you could easily achieve this with a standard ScrollView or with the CustomListview class.
Such a pity, I really like this flexible table... :-(
Thank you very much.
 

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, all. Thank you in advance for answering my question.

Question:
Is there a way to prevent sort table on header_click? The sort feature is a very attractive feature, but many tables require to be static and not resorted accidentally by the user.

Any and all help will be welcomed.

Best regards.

Sandy
 

tdocs2

Well-Known Member
Licensed User
Longtime User
You have the source code.

Just add a global Boolean variable (or property!), set it and check it on click


[P.S. ehm... if it does not already exist!]

Thank you, Luca.

1. On every Flex Table Class update, I would have to remember what I did and reinstate it.
2. I think it is a good request that other users in the community would benefit.
3. I am not that proficient with Class modules.

And on your P.S. - I looked at the class code - I did not see a way to do it, but I may have missed it.

Best regards.

Sandy
 

klaus

Expert
Licensed User
Longtime User
It is very simple, but this is his creature
The class was basicaly wrtitten by Erel, some other users including me have added new features to the class.

In the first post you find version 1.35 including the new SortColumn property.
 

klaus

Expert
Licensed User
Longtime User
Hello friends, I'm trying to build some kind of calendar with this class and I would like to highlight the days of Saturday and Sunday with a different color, is it possible?
Adding an option to set different column colors instead of 2 row colors is relatively easy.
If you are interested in I could add it.
 

tdocs2

Well-Known Member
Licensed User
Longtime User
The class was basicaly wrtitten by Erel, some other users including me have added new features to the class.

In the first post you find version 1.35 including the new SortColumn property.

Thank you, Klaus.

I will repeat what I said in an earlier post:

This extended table class is a great contribution to the community. VERY powerful tool! Thank you.

Best regards.

Sandy
 

Kapelis

Member
Licensed User
Longtime User
Adding an option to set different column colors instead of 2 row colors is relatively easy.
If you are interested in I could add it.
It would be great to be able to give a different color in a row when a condition occurs. Thank you very much Klaus.
 

klaus

Expert
Licensed User
Longtime User
To be clear, it will not be possible to set different colors in different rows depending on conditions.
This would need to rewrite the core of the class and probably slow down the scrolling speed.
My proposal is to add the option to set colors for the columns but only one color for the whole column which means the same colors in all rows.
 

Kapelis

Member
Licensed User
Longtime User
This would be useful too, thanks again
 

Bryan

Member
Licensed User
Longtime User
I'm using an older version 1.13 at this time. I've had to make a few changes to the class to correct some bugs. Mostly with removal of rows, particularly when at the last row in the table. Anyways, Would it be a problem updating the version to the latest one as far as having to make any significant code changes in the app I working on. My table is loaded and saved from a csv file.
Another question I have is, can an image be put into the background of cells (label background) possibly that will fill the cell if the cell is changed in width. Maybe possibly use an image for the background of an entire column? I want to change the look of the table a bit rather then just change the color of the rows.
Thanks
Bryan
 

klaus

Expert
Licensed User
Longtime User
Would it be a problem updating the version to the latest one as far as having to make any significant code changes in the app I working on.
No, I don't think so. Aa far as I know all routines remain the same to garanty upward compatibility.

Another question I have is, can an image be put into the background of cells (label background) possibly that will fill the cell if the cell is changed in width.
I don't understand what you mean with possibly that will fill the cell if the cell is changed in width ?
I think it could be, needs to change the class code, but only for rows (same for the whole row) or for columns (same for the whole column).
Depending on the number of rows you could write your own 'Table' class or ScrollView management without the dynamic loading of the labels but with specific Label changes.

Maybe possibly use an image for the background of an entire column?
No, because the rows are loaded and released dynamicaly.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…