The example initializes the table in the
InitTable method and names the columns in the header.
The
"FillTable" method gets an array of values using the
designer method GetDataTable, to populate its contents.
The
"InitTable" method is located on the "
Methods" tab and is triggered in the
onStart event of the
PmgWTable object.
There is also the
"FillTable" method, which will run in the
onStart event or in the
onRefresh event if the values in the table change frequently.
A new
PmgWTable object is created in the panel.
In this object, the methods
InitTable and
FillTable (without parameters) are created.
In the
onStart event the script is added.
A new designer method
GetDataTable (without parameters) is created in the panel.
The method InitTable:
Initialization of table dimensions and setting the table column names
JavaScriptSelect and copy to clipboard
// Dim(Cols,Rows,FixedCols,FixedRows,CellWidth,CellHeight,Interaction,Grid)
pMe.Dim(4, 1, 0, 1, 60, 20, 1, true);
pMe.SetCellText(0, 0, "col 0");
pMe.SetCellText(0, 1, "col 1");
pMe.SetCellText(0, 2, "col 2");
pMe.SetCellText(0, 3, "col 3");
pMe.Draw();
If the values in the table change frequently, then the
FillTable method can also be called in the
onRefresh event.
JavaScriptSelect and copy to clipboard
pMe.Methods.InitTable();
pMe.Methods.FillTable();
GetDataTable panel method:
An example is given, that returns an array of values from the
PmaDataTable object.
But it can also be another data source from the application that populates the table.
JavaScriptSelect and copy to clipboard
var aData = pMe.Pm("/DataTable").GetArray("All", null);
return Pm.TransformValue(aData, 50);