B4A Library [Class] Flexible Table

LucaMs

Expert
Licensed User
Longtime User
[I will move/copy this post to the right thread - ScrollView2D]

This table could be better if:

1) you could lock first column and/or first row;
2) you could scroll not simultaneously in both directions, only horizontally or only vertically, if you want (I do not like seasickness );
3) you could directly edit the content of a single cell (at least using a dialog for the input);
4) you could set a spinner in a cell (or show a dialog with a spinner);
5) other
 

klaus

Expert
Licensed User
Longtime User
1) Lock first row, not that easy, because of the dynamic generation of the Labels.
For the first row, there are the headers.
2) I'm afraid that this could, would be confusing for the user depending on the algorithm used to define the direction.
3) This can be implemented outsides the Table Class.
4) This would be a deep change in the class, because of the dynamic generation of the Labels.

I find that with more and more options this class is becoming too big and complicated.
For me it's already too complicated.

But, feel free to make it better !
 
Last edited:

luciano deri

Active Member
Licensed User
Longtime User
This is the desire: If i scroll in horizontal direction the HorizontalScrollView capture the event, and when the touch is a vertical direction the event is for the table that have more row of height activity.
My second option is: when the table is show the HorizontalScrollView doesn't capture the Touch, i can do a event that destroy the table when i need move the HorizontalScrollW down.
If the table is on a panel in the same activity of scrollw. is ok, but if the table is on activity on a panel inside at ScrollW i have this problem.
 

LucaMs

Expert
Licensed User
Longtime User
1) Lock first row, not that easy, because of the dynamic generation of the Labels.
For the first row, there are the headers.
It is enough, I think

2) I'm afraid that this could, would be confusing for the user depending on the algorithm used to define the direction.

This requires a change in ScrollView2D. Its scrolling is "not so nice". It should work like: if the user moves his finger horizontally, scroll the table horizontally, else vertically.
This is the most important change that I wish; for this reason I wrote that I will have to move the post in the right thread.

3) This can be implemented outsides the Table Class.
4) This would be a deep change in the class, because of the dynamic generation of the Labels.

3-4 are similar.
An object associated to each cell would be useful (clsCellInfo, for example). This object could contain informations such as:
Editable: True / False;
SpinnerData (list).

if Editable then
-- if SpinnerData.IsInitialized, when the user selects the cell, show a dialog containg the spinner
-- else show dialog containing an EditText (or a View to select a Date, if... read below).

Furthermore, the object associated to the cell may contain other informations about the cell content, such as whether it is a Date, a decimal number, the font, [data binding], and more.


But, feel free to make it better !

If ScrollView2D changes as I have described, I think I would develop these changes (at least some of them).
 

luciano deri

Active Member
Licensed User
Longtime User
For now i can solve with this method:
If i develop a grid using a scrollview in a activity display on a panel on a horizontal scroll view every event is executed correctly.
If i scroll on horizontal direction only HSW has moved, else if i scroll vertical direction only grid has scrolled.
 

luciano deri

Active Member
Licensed User
Longtime User
I not use Flexible Table Classe for create the grid of detail, but i develop this add panel such as row of db on a normal ScrollView. In this case the event of HSW and SW can do intercept correctly.
 

luciano deri

Active Member
Licensed User
Longtime User
In breve l'HorizontalScrollView può contenere un pannello con una ScrollView normale (probabilmente anche una list view)con cui si realizza la tabella. Il sistema gestisce bene gli scroll orizzontali e verticali. Probabilmente il difetto della classe Flexible Table sta proprio sul fatto che accetta ogni direzione di scroll.
 

LucaMs

Expert
Licensed User
Longtime User

Are you sure? (you should translate that post also in english)

Perhaps for one of these two reasons (?):

the ScrollView in the panel scrolls vertically while HSV horizontally
or
you do not touch the ScrollView when you scroll horizontally


I want to try
 

klaus

Expert
Licensed User
Longtime User
Google translation.

Could you please post a small project showing the principle.
 

LucaMs

Expert
Licensed User
Longtime User
Just another test on the fly (attached).

I have a "simple" problem: how can I set the "event name" of x ScrollViews added by code?

Usually, the initialization of a view requires that "event name" as parameter, ScrollView requires its height!
 

Attachments

  • HSV and SV test 2.zip
    12.5 KB · Views: 234
Cookies are required to use this site. You must accept them to continue using the site. Learn more…