Version 1.20 Maintenance
1. SDUITable - AddColumnFileInput
Code:
tb4.AddColumnFileInput("product", "Choose Product")
Update the value of a ow at a column posititon. In this example we upload the file to the server and then get its paths and update the avatar column in that row with the new image.
Code:
Private Sub tb4_ChangeRow (Row As Int, Value As Object, Column As String, item As Map)
Log("tb4_ChangeRow...")
Select Case Column
Case "product"
'value is the file object
Dim fd As FileObject = SDUIShared.UploadFileWait(Value)
Log(fd)
'get the file name
Dim fn As String = fd.FileName
'get the status of the upload
Dim sstatus As String = fd.Status
Select Case sstatus
Case "error"
Return
Case "success"
End Select
'get the upload full path
Dim fp As String = fd.FullPath
tb4.SetRowColumn("avatar", Row, fp)
End Select
Log(Row)
Log(Value)
Log(Column)
Log(item)
End Sub
2. Change "Select Items" for columnin a table for all rows
Code:
'change the select items for all rows
banano.Await(tb4.SetSelectListItems("country", Array("Afghanistan", "Albania", "Australia", "USA", "Brazil", "Chile", "Guinea", "South Africa", "Nigeria")))
This changes the select items in a column for all rows in the table. This should be done after rows are added.
3. Change "Select Items" for a column for a particular row
Code:
'change the select items for row 2
banano.Await(tb4.SetSelectListItemsOfRow("country", 2, Array("Afghanistan1", "Albania1", "Australia1", "USA", "Brazil", "Chile", "Guinea", "South Africa", "Nigeria1")))
4. Change the value of a paticular row & column item. In the avatar column on row 1, change the value to be a:/anele/pic1.jpg"
Code:
tb4.SetRowColumn("avatar", 0, "c:/anele/pic1.jpg")
Ceveat: works for toggle, checkbox, range, progress, select, textbox, textarea, datepicker, timepicker, password, number, textarea, badge, avatar, normal column, image
5. Change the row data. The row data should be key values where the key is the column name and value is the new value.
Code:
tb4.Setrow(1, CreateMap("id":1, "avatar": "x" ...))
Ceveat: works for toggle, checkbox, range, progress, select, textbox, textarea, datepicker, timepicker, password, number, textarea, badge, avatar, normal column, image
NB: Please download