Hi everyone. Thanks in advance.
I have this code for creating columns and it works as expected:
$w(“#myGrid”).columns = [
{ “id”: “1”, “label”: “one”, “width”: 15, “datapath”: “1”, “visible”: true , “type”: “string” },
{ “id”: “2”, “label”: “two”, “datapath”: “2”, “width”: 15, “visible”: true , “type”: “string” },
{ “id”: “3”, “label”: “three”, “datapath”: “3”, “width”: 15, “visible”: true , “type”: “string”},
{ “id”: “4”, “label”: “four”, “datapath”: “4”, width": 15, “visible”: true , “type”: “string” }
];
However, I can’t get the rows to populate.
I’ve tried copying and editing the code from http://intense-brook-61045.herokuapp.com/$w.Grid.html#columns, and that didn’t work.
I tried using the syntax found on https://www.wix.com/code/reference/$w.Table.html#rows but that didn’t work.
I’ve tried using single, double and no quotes around the ID and Label fields, but that didn’t produce output either.
Currently, the latest try is this:
let myGrid = $w(“#myGrid”);
let rowData = myGrid.rows;
rowData.push({
one:“D”,
two:“g”,
three:“N”,
four:“g”
});
With the above I do get a single row (intended), but no text shows in any column. Can someone please tell me what I’ve overlooked? I’ve tried many variations and I don’t know what I’m not understanding about tables/grids.
I’m not using a database for the data; I’m just hard coding it right now.
Thanks all.
LT.