LUA object: tableview

The object represents an additional table within a dataview form. The tableview can only be saved through its parent dataview object, if present.

AvailabilityThe object is available only in specific execution contexts, or is created by a function provided by other objects
Pre-initialized inRow added to a data table, Pre-save of data table row, Counter acquisition for a data table row, Post-save of data table row, Pre-move of data table row to recycle bin, Row restored from recycle bin, Pre-deletion of data table row, Post-deletion of data table row, Row action on a data table, Value changed in a data table row cell
rowinvoice = customerview.getatable("invoice_rows")
for i=10,1,-1 do
   row = rowinvoice.adddatarow()
   row.setvalue("code",i)
end
customerview.save()

adddatarow

DescriptionAdds a new datarow object to the collection of rows present within the table
Value Typedatarow
Formatdatarow = tableview.adddatarow()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
row = tableview.adddatarow()

countrows

DescriptionReturns the number of datarows present in the table
Value Typesingle
Formatsingle = tableview.countrows()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
number_row = tableview.countrows()

dataview

DescriptionRetrieves the dataview containing this tableview if present
Value Typedataview
Formatdataview = tableview.dataview()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
view = tableview.dataview()

deletedatarow

DescriptionDeletes a specific datarow from the tableview
Value Typeboolean
Formatboolean = tableview.deletedatarow(row)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
rowdatarowThe datarow to be deleted
Examples
bool = tableview.deletedatarow(row)

enableadd

DescriptionEnables or disables the button to add rows in the table
Value Typeboolean
Formatboolean = tableview.enableadd
TypeProperty
SystemsWindows, Web, Android, IOS, Mac OS

enableorder

DescriptionActivates or deactivates the buttons for sorting the rows in the table
Value Typeboolean
Formatboolean = tableview.enableorder
TypeProperty
SystemsWindows, Web, Android, IOS, Mac OS

enableremove

DescriptionActivates or deactivates the button to delete the rows in the table
Value Typeboolean
Formatboolean = tableview.enableremove
TypeProperty
SystemsWindows, Web, Android, IOS, Mac OS

enablevalue

DescriptionEnables or disables editing of a specific column
Value Type
Formattableview.enablevalue(fieldname, enabled)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
fieldnamestringThe name of the column in the table
enabledbooleanThe value that enables or disables editing
Examples
tableview.enablevalue("name",true)

getrows

DescriptionRetrieves the complete list of datarows present in the table
Value Typelist<datarow>
Formatlist<datarow> = tableview.getrows()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
rows = tableview.getrows()

showconfirm

DescriptionDisplays a confirmation message
Value Type
Formattableview.showconfirm(message)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
messagestringThe message to display
Examples
tableview.showconfirm("Save confirmed")

showerror

DescriptionDisplays an error message
Value Type
Formattableview.showerror(message)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
messagestringThe message to display
Examples
tableview.showerror("Error!")

showwarning

DescriptionDisplays an alert message
Value Type
Formattableview.showwarning(message)
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
ParameterValue TypeDescription
messagestringThe message to display
Examples
tableview.showwarning("Warning!")

tablename

DescriptionReturns the name of the table
Value Typestring
Formatstring = tableview.tablename()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
tablename = tableview.tablename()

update

DescriptionForces the update of the calculation expressions present in the table
Value Type
Formattableview.update()
TypeMethod
SystemsWindows, Web, Android, IOS, Mac OS
Examples
tableview.update()