Android Tutorial [B4X] B4XTable - Editable table and export to CSV

Erel

Administrator
Staff member
Licensed User


This example shows how to modify the table data. When the user clicks on a cell we show an input dialog and let the user modify its content.

The data in B4XTable is stored in an in-memory database. The table name is 'data' and the column names are available with B4XTableColumn.SQLID.

The code to update a cell:
B4X:
B4XTable1.sql1.ExecNonQuery2($"UPDATE data SET ${column.SQLID} = ? WHERE rowid = ?"$, Array As String(InputTemplate.Text, RowId))
When the window is closed the updated data is saved in a CSV file.

This is a B4J example, however it should be trivial to port it to B4A or B4i.

More advanced editable table: https://www.b4x.com/android/forum/threads/b4x-cross-platform-editable-b4xtable-form-example.104766/
 

Attachments

Last edited:

asales

Well-Known Member
Licensed User
To Android: is possible to have a click in the cell to get the value and a LongClick to edit the cell?
 

Beja

Expert
Licensed User
Hi
Thanks Erel for this wonderful and easy to use table. At this time I can't test the example but I am just wondering if it contains the regular editing functions like add row, delete row, find...etc.
 
Top