Feb 18, 2019 Replies: 5 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: Code: 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 B4XTable-Editable.zip B4XTable-Editable.zip 52.1 KB · Views: 2,913 Last edited: Apr 11, 2019 Click to expand...
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: Code: 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/
asales Expert Licensed User Longtime User Feb 18, 2019 #2 To Android: is possible to have a click in the cell to get the value and a LongClick to edit the cell?
To Android: is possible to have a click in the cell to get the value and a LongClick to edit the cell?
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2019 #3 asales said: To Android: is possible to have a click in the cell to get the value and a LongClick to edit the cell? Click to expand... B4XTable v1.08 adds long click events. It should be simple to implement this with the new event.
asales said: To Android: is possible to have a click in the cell to get the value and a LongClick to edit the cell? Click to expand... B4XTable v1.08 adds long click events. It should be simple to implement this with the new event.
asales Expert Licensed User Longtime User Feb 19, 2019 #4 Erel said: B4XTable v1.08 adds long click events. It should be simple to implement this with the new event. Click to expand... Thanks! Works fine. The example to Android is in attached. Attachments B4XTable-Editable-B4A.zip B4XTable-Editable-B4A.zip 60.6 KB · Views: 1,967
Erel said: B4XTable v1.08 adds long click events. It should be simple to implement this with the new event. Click to expand... Thanks! Works fine. The example to Android is in attached.
Beja Expert Licensed User Longtime User Mar 6, 2019 #5 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Mar 6, 2019 #6 No. Only editing existing cells. It shouldn't be too difficult to add new rows or delete rows.