Hi All,
I am working in NG Desktop client and need to create Servoy Extra Table web component dynamically.
Any help will be highly appreciated.
Regards
function onLoad(event) {
var meineTabelle = elements.meinetabelle; // Look for the "table"-component
meineTabelle.addStyleClass("mycss"); // set the style class of my table with the api
var datumFeld = meineTabelle.newColumn("datum_vorgaenge"); // create a new column with dataprovider "datum_vorgaenge"; return a "column"-object
// Set the different properties for the column
datumFeld.headerText = "Vorgangsdatum";
datumFeld.width = 250;
datumFeld.format = "dd.MM.yyyy";
// more columns to come...
}
var detailForm = solutionModel.getForm("test2");
var table = detailForm.newWebComponent('table1','servoyextra-table');
var columns = [];
/** @type {CustomType<servoyextra-table.column>} */
var column = {};
column.dataprovider = "productid"
column.headerText = "Product"
column.valuelist = "products"
columns.push(column);
table.setJSONProperty('columns',columns);
paronne wrote:Hi,
if you create the table with solutionModel. You can use the setJSONProperty("columns", myArrayOfColumns);
- Code: Select all
var columns = [];
/** @type {CustomType<servoyextra-table.column>} */
var column = {};
column.dataprovider = "productid"
column.headerText = "Product"
column.valuelist = "products"
columns.push(column);
table.setJSONProperty('columns',columns);
Regards,
Paolo
Users browsing this forum: No registered users and 4 guests