B4J Question B4XTable - A Property Bag Use Case - A couple of questions

Mashiane

Expert
Licensed User
Longtime User
Hi

I'm starting to explore the b4xtable and have a couple of questions. Its the first time I am using it and have been searching and finding solutions in the forum.


1696014626379.png


This is what I have been able to achieve so far...

B4XTableExample.gif



Q1. How do I hide the pagination component on top?
Q2. How do I resize search to fit width of available area e.g 100%
Q3. How do I disable sorting on header click?
Q4. For numeric values, how do I leave them as integers and not show as 5.0, I am using B4XPlusMinus as the editor on the row

Q5. How do I add padding to the contents of the columns? I have applied left alignment to them, even on the TextField editor for page name & page title.
Q6. Is it possible just to return or set the contents of the page e.g. page 1, perhaps as a map, e.g. I just have 2 columns so I would like to return a key value map.
Q7. Id like to use the TAB key press to move to the next element on the second column after edit, is it possible to do that or even pressing enter to navigate to the next row.

Thank you so much.

Dependencies: https://www.b4x.com/android/forum/threads/jreflection-library.35448/#content
 

Attachments

  • SithasoDesignerQuestions.zip
    12.8 KB · Views: 45
Last edited:

Mahares

Expert
Licensed User
Longtime User
Q1. How do I hide the pagination component on top?
After you define the columns:
B4X:
Sleep(0)
 B4XTable1.lblFirst.Parent.Visible =False

Q3. How do I disable sorting on header click?
B4X:
For Each c As B4XTableColumn In B4XTable1.Columns
        c.Sortable = False  'you can also remove the sort on individual columns
    Next
Too many questions for one thread. I did not have time to look at all questions. You might get faster and more members help if you post the project you are working with
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Q4. For numeric values, how do I leave them as integers and not show as 5.0, I am using B4XPlusMinus as the editor on the row
In this sub: Private Sub IE_GetUpdatedValue (FC As FocusedCell) As Object
Change this line:
B4X:
If Numbers.ContainsKey(sDetails) Then Return B4XPlusMinus1.SelectedValue
To this line:
B4X:
If Numbers.ContainsKey(sDetails) Then Return NumberFormat(B4XPlusMinus1.SelectedValue,1,0)
The only reason you were getting the decimal is because the column was defined as COLUMN_TYPE_TEXT in your B4XTable

Q2. How do I resize search to fit width of available area e.g 100%
If you unzip the B4XTable lib, you will see in the Files folder a layout file called: b4xtable.bjl. It has the B4XFLoatTextfield that you can add it to your project and change its location and dimensions. When you add that bjl file, keep it in your project as part of the layouts. There maybe another of doing this one.
Sorry, I cannot run or help with your project any further because it has several libraries I never used or familiar with. Your project has more stuff than simply pertains to B4XTable.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thank you so much for your help.
Check everything to make sure it does the job for you before you even thank or like. I prefer to know after you have tested the answers. I think, you will have more people answering if you strip it to B4XTable relevance. I was pretty sure the answers I gave you work, but, I would have been more comfortable if I actually tested them in your project
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Check everything to make sure it does the job for you before you even thank or like. I prefer to know after you have tested the answers. I think, you will have more people answering if you strip it to B4XTable relevance. I was pretty sure the answers I gave you work, but, I would have been more comfortable if I actually tested them in your project
Already tested, they work and are included in the new zip file posted. I still need to look into the search. For now I have lined through the working issues.

Thanks again.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I still need to look into the search
Why do you really want to expand the search box to fit the entire width of the table. Normally when you do a search, you simply type a few letters and it will match them anywhere in the text. You do not need much space for the search string. What you have in your screenshot looks sufficient.
 
Upvote 0
Top