Public Sub Initialize(Callback As Object, EventName As String)
Prepare the instance before its other methods.
ELEVATEUI · B4A · XUI
Editable spreadsheet-style grids for structured data entry.
Navigation & onboarding
Editable spreadsheet-style grids for structured data entry.
Animated conceptual demonstration, not an exact Android control screenshot.
Create an inventory editor with row insertion, column changes and cell-edit events connected to your data model.
Before integrating, examine its methods, events and Designer options.
Tutorials are based on existing project examples or audited APIs. Check each example’s prerequisites; B4A compilation is not claimed.
Review required libraries, Designer views and input data before compiling in B4A.
Sub Globals
Private xui As XUI
Private Editable As UIEditableTable
End Sub
Sub Activity_Create(FirstTime As Boolean)
Editable.Initialize(Me, "Editable")
Editable.AddToParent(Activity, 10dip, 22dip, Activity.Width - 20dip, 390dip)
Editable.AddColumns(Array As String("Producto", "Cantidad", "Precio", "Total"))
Editable.SetColumnType(1, Editable.COLUMN_TYPE_NUMBER)
Editable.SetColumnType(2, Editable.COLUMN_TYPE_DECIMAL)
Editable.AddRow(Array As String("Cacao", "2", "12.50", ""))
Editable.AddRow(Array As String("Café", "3", "7.50", ""))
Editable.SetFormula(3, 0, "=B1*C1")
Editable.SetFormula(3, 1, "=B2*C2")
End Sub
Private Sub Editable_CellClick(Col As Int, Row As Int)
Log("Celda: " & Col & "," & Row & " = " & Editable.GetValue(Col, Row))
End Sub
Review required libraries, Designer views and input data before compiling in B4A.
' Editable ya tiene cuatro columnas y tres filas.
Editable.SetValue(1, 0, "2")
Editable.SetValue(1, 1, "3")
Editable.SetValue(1, 2, "5")
Editable.SetFormula(3, 0, "=SUM(B1:B3)")
Editable.SetFormula(3, 1, "=AVERAGE(B1:B3)")
Dim parametros As List
parametros.Initialize
parametros.Add("x")
Editable.SetFormulaFunction("DOBLE", parametros, "x*2")
Editable.SetFormula(3, 2, "=DOBLE(B3)")
Log(Editable.GetFormula(3, 2))
Log(Editable.GetValue(3, 2))
Review required libraries, Designer views and input data before compiling in B4A.
' Ejecutar después de crear Editable y cargar datos.
Editable.Language = "es"
Editable.SetTheme("Ocean")
Editable.SetFilterEnabled(True)
Editable.AddSearchBox
Private Sub Editable_FilterChanged(ActiveFilters As Int)
Log("Filtros activos: " & ActiveFilters)
End Sub
Review required libraries, Designer views and input data before compiling in B4A.
' producto.png debe estar en Files.
Dim foto As Bitmap = LoadBitmap(File.DirAssets, "producto.png")
Editable.SetHeaderImage(0, foto, 20dip, 20dip)
Editable.SetCellImage(0, 0, foto, 28dip, 28dip)
Dim estado As Label
estado.Initialize("")
estado.Text = "✓"
estado.TextColor = Colors.Green
Editable.AddCellElement(0, 0, estado.As(B4XView), 5dip, 2dip, 26dip, 24dip)
Review required libraries, Designer views and input data before compiling in B4A.
Editable.SetTheme("Graphite")
Dim p As List
p.Initialize
p.Add("x")
Editable.SetFormulaFunction("DOBLE", p, "x*2")
Editable.SaveProperties(File.DirInternal, "tabla.map")
' En otra sesión, una vez creada Editable:
Editable.LoadProperties(File.DirInternal, "tabla.map")
39 audited signatures
Public Sub Initialize(Callback As Object, EventName As String)
Prepare the instance before its other methods.
Public Sub AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)
Add this view to a parent container using the supplied bounds and options.
Public Sub AddToView(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)
Use AddToView for its named operation; follow its exact signature.
Public Sub DesignerCreateView(Base As Object, Lbl As Label, Props As Map)
Invoked automatically by the B4A Visual Designer; do not call manually.
Public Sub setLanguage(Language As String)
Update language at runtime when this setting changes.
Original catalog note: Sets the table UI language. Use Auto to follow the device language.
Public Sub getLanguage As String
Read the current language value for validation or UI synchronization.
Returns: String
Public Sub SetFilterEnabled(Enabled As Boolean)
Use SetFilterEnabled for its named operation; follow its exact signature.
Original catalog note: Shows or hides the optional toolbar filter action. Disabled by default.
Public Sub GetFilterEnabled As Boolean
Use GetFilterEnabled for its named operation; follow its exact signature.
Returns: Boolean
Public Sub AddColumns(Columns() As String)
Use AddColumns for its named operation; follow its exact signature.
Returns: String)
Public Sub SetColumnType(Index As Int, ColumnType As Int)
Use SetColumnType for its named operation; follow its exact signature.
Original catalog note: Sets the editor keyboard for a column. Numeric columns use a number pad; decimal columns use the decimal-number keyboard.
Public Sub GetColumnType(Index As Int) As Int
Use GetColumnType for its named operation; follow its exact signature.
Returns: Int
Public Sub AddSearchBox
Use AddSearchBox for its named operation; follow its exact signature.
Original catalog note: Opens a floating search panel for all columns. The column menu can scope it to one column.
Public Sub DeleteSelectedRow
Use DeleteSelectedRow for its named operation; follow its exact signature.
Original catalog note: Deletes the currently selected row, if a cell is selected.
Public Sub DeleteRow(RowIndex As Int)
Use DeleteRow for its named operation; follow its exact signature.
Original catalog note: Deletes the row at the specified zero-based index.
Public Sub AddColumn(NewColumnName As String)
Use AddColumn for its named operation; follow its exact signature.
Public Sub AddRow(Values() As String)
Use AddRow for its named operation; follow its exact signature.
Returns: String)
Public Sub AddEmptyRow
Use AddEmptyRow for its named operation; follow its exact signature.
Public Sub AddEmptyRows(Count As Int)
Use AddEmptyRows for its named operation; follow its exact signature.
Original catalog note: Adds multiple empty rows to the table.
Public Sub AddRows(Rows As List)
Use AddRows for its named operation; follow its exact signature.
Public Sub GetValue(Col As Int, Row As Int) As String
Use GetValue for its named operation; follow its exact signature.
Returns: String
Public Sub SetValue(Col As Int, Row As Int, Value As String)
Use SetValue for its named operation; follow its exact signature.
Public Sub SetHeaderImage(Col As Int, Image As Bitmap, Width As Int, Height As Int)
Use SetHeaderImage for its named operation; follow its exact signature.
Original catalog note: Adds or replaces a bitmap beside a column heading. Use 0 for a compact default size.
Public Sub ClearHeaderImage(Col As Int)
Use ClearHeaderImage for its named operation; follow its exact signature.
Public Sub GetCellContentPanel(Col As Int, Row As Int) As B4XView
Use GetCellContentPanel for its named operation; follow its exact signature.
Original catalog note: Returns the transparent host panel for a cell; add multiple B4X/ElevateUI views to it.
Returns: B4XView
Public Sub AddCellElement(Col As Int, Row As Int, Element As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)
Use AddCellElement for its named operation; follow its exact signature.
Original catalog note: Places an already-created B4X view inside a cell (coordinates are relative to that cell).
Public Sub SetCellImage(Col As Int, Row As Int, Image As Bitmap, Width As Int, Height As Int)
Use SetCellImage for its named operation; follow its exact signature.
Public Sub ClearCellImage(Col As Int, Row As Int)
Use ClearCellImage for its named operation; follow its exact signature.
Public Sub ClearCellElements(Col As Int, Row As Int)
Use ClearCellElements for its named operation; follow its exact signature.
Public Sub SetFormula(Col As Int, Row As Int, Formula As String)
Use SetFormula for its named operation; follow its exact signature.
Original catalog note: Sets a spreadsheet-style formula such as "=A1+B1". References use A1 notation.
Public Sub GetFormula(Col As Int, Row As Int) As String
Use GetFormula for its named operation; follow its exact signature.
Original catalog note: Returns the stored formula, or an empty string when the cell is a literal value.
Returns: String
Public Sub SetFormulaFunction(FunctionName As String, Parameters As List, Expression As String)
Use SetFormulaFunction for its named operation; follow its exact signature.
Original catalog note: Registers a reusable arithmetic formula, for example DUPLICAR(x) = x*2. The definition is saved with the table properties and restored by SetProperties / LoadProperties.
Public Sub RemoveFormulaFunction(FunctionName As String)
Use RemoveFormulaFunction for its named operation; follow its exact signature.
Original catalog note: Removes a custom formula function and its persisted definition.
Public Sub GetProperties As Map
Use GetProperties for its named operation; follow its exact signature.
Original catalog note: Returns a copy of the table properties so the caller can persist them with its settings store.
Returns: Map
Public Sub SetProperties(Properties As Map)
Use SetProperties for its named operation; follow its exact signature.
Original catalog note: Restores properties previously returned by GetProperties.
Public Sub SaveProperties(Dir As String, Filename As String)
Use SaveProperties for its named operation; follow its exact signature.
Original catalog note: Writes the current theme properties to a caller-selected settings file.
Public Sub LoadProperties(Dir As String, Filename As String)
Use LoadProperties for its named operation; follow its exact signature.
Original catalog note: Loads theme properties previously written with SaveProperties.
Public Sub SetTheme(ThemeName As String)
Use SetTheme for its named operation; follow its exact signature.
Public Sub GetThemeNames As List
Use GetThemeNames for its named operation; follow its exact signature.
Returns: List
Public Sub GetBase As B4XView
Use GetBase for its named operation; follow its exact signature.
Returns: B4XView
#DesignerProperty: Key: Theme, DisplayName: Theme, FieldType: String, DefaultValue: Mint, List: Mint|Ocean|Violet|Graphite|Rose|Amber|Lagoon|Transparent, Description: Table color palette#DesignerProperty: Key: FilterEnabled, DisplayName: Enable filters, FieldType: Boolean, DefaultValue: False, Description: Show the filter button and floating filter panel#DesignerProperty: Key: Language, DisplayName: Language, FieldType: String, DefaultValue: Auto, List: Auto|ar|bn|de|en|es|fr|hi|pt|ru|zh, Description: UI language; Auto follows the device languageInitialize with Me and the event prefix Demo, then add the following handler to your B4A module. Names and arguments come from the library declaration.
Raised when the user taps the control; use it to trigger a real action.
B4A handler signature with Demo prefix
Private Sub Demo_CellClick(Col As Int, Row As Int)
Log("CellClick")
End Sub
Raised when a selection or value changes; use it to update dependent data.
B4A handler signature with Demo prefix
Private Sub Demo_ThemeChanged(ThemeName As String)
Log("ThemeChanged")
End Sub
Event declared by this module. Handle the indicated action in the callback.
B4A handler signature with Demo prefix
Private Sub Demo_ColumnDeleted(Col As Int)
Log("ColumnDeleted")
End Sub
Raised when a selection or value changes; use it to update dependent data.
B4A handler signature with Demo prefix
Private Sub Demo_FilterChanged(ActiveFilters As Int)
Log("FilterChanged")
End Sub
For code-created controls use Initialize(Me, "Demo") when that signature exists; for Designer controls set the event name there. Replace Demo with the actual prefix.
Public Const COLUMN_TYPE_TEXT = 1 As IntPublic Const COLUMN_TYPE_NUMBER = 2 As IntPublic Const COLUMN_TYPE_DECIMAL = 3 As IntPublic mBase As B4XViewPublic Grid As UITable