Hello there, again
Always experimentig around datatables and ingenous ways on how to populate them.
I'm writing a web app in wich the user select some items from a table, it adds other parameters to it (such as quantity, package, customization etc.) and all the choosen items are safely stored in a txt file in this way:
(this is just a test, forget about the null value).
I would like to grab those lines and populare another datatable where the user could review their choices.
Each line inside [ ] should be a row, and each column is separated by the comma.
I was studying this function as a reference:
I know this works grabbing data from a ResultSet (wich is AWESOME!), but I can't find a way to work out how to proper store a list of arrays (wich is how the txt file is written).
Any suggestion are kindly welcome ^^
Always experimentig around datatables and ingenous ways on how to populate them.
I'm writing a web app in wich the user select some items from a table, it adds other parameters to it (such as quantity, package, customization etc.) and all the choosen items are safely stored in a txt file in this way:
B4X:
[AGRUMI MISTI VASO 18, 1, 6, null]
[GERANIO PARIGINO V.27 COLONNA, 1, 6, null]
[ROSA VASO 18 PIRAMIDE, 1, 6, null]
[CICLAMINO MINI V. 11 PL., 1, 6, null]
[GERANIO PARIGINO V.27 COLONNA, 1, 6, null]
I would like to grab those lines and populare another datatable where the user could review their choices.
Each line inside [ ] should be a row, and each column is separated by the comma.
I was studying this function as a reference:
B4X:
Sub FillStudentsTable(jq As JQueryElement, rs As ResultSet)
DateTime.DateFormat = "yyyy/MM/dd" 'sortable format
Dim data As List
data.Initialize
Do While rs.NextRow
Dim row As List
row.Initialize
For c = 0 To rs.ColumnCount - 1
Dim val As String = rs.GetString2(c)
If c = 3 Then
'convert the birthday ticks value to a date string
val = DateTime.Date(val)
End If
row.Add(val)
Next
data.Add(row)
Loop
rs.Close
jq.RunMethod("dataTable", Array As Object(CreateMap("aaData": data, "bFilter": False, _
"bPaginate": True)))
'bind the selection changed event to the students table
ws.RunFunction("addSelectionToTable", Array As Object(tblStudents.Id, "TableView1_SelectedRowChanged"))
End Sub
I know this works grabbing data from a ResultSet (wich is AWESOME!), but I can't find a way to work out how to proper store a list of arrays (wich is how the txt file is written).
Any suggestion are kindly welcome ^^