I see you have a grid defined as html and parsed out, like Dojo.
Does it make sense to have a grid defined as JSON that could do something like
grid = new Grid(json);
I guess its the advanced functionality with functions and the like where you would run into limitations but I could see how it could be more convenient for the server to generate json for simple tables.
I'm not sure where you are getting your impressions from.
new Grid({ object notation }) is exactly how it works.
You pass an object.
JSON is a string encoding of an object. So if you have JSON, you need to use JSON.parse to turn it into an object, then pass it to the Grid constructor. It's that simple.
Its not something I would tackle any time in the next year I think, when I originally asked it was because I could have written better server side java code by creating a single java class that was the grid and then send it as json to the front end to be created. But I couldn't understand how the dynamic javascript code in processtimes could be represented as json.
processItems({ items, record, column }) {
for (var key in items) {
var item = items[key];
if (item.text && item.text.includes("quals")) {
item.hidden = true;
}
if (window.genericgrid && window.genericgrid.selectedRecords && window.genericgrid.selectedRecords.length > 1) {
if (item.text && item.text.includes("Copy")) {
item.hidden = true;
}
if (item.text && item.text.includes("Edit")) {
item.hidden = true;
}
}
}
}, }
},
Not too important right now, just my confusion with javascript and json.