Solved
Grid widget dynamic config - styling and column sorting
- February 17, 2022
- 1 reply
- 4090 views
Hi,
I am using Thingworx 9.3.0 and trying to configure the Grid widget with a JSON. Currently I am having some troubles with small details. Unfortunately the documentation for this JSON is erroneous (missing closing brackets and wrong quotation marks) and also not complete. I also downladed the Grid Advanced sample files which helped a bit. But there are still a few issues:
- How can I enable sorting for specific columns? I can do this in the mashup configuration for the Grid widget. But via config I was only able to enable sorting for all columns through { "columns": { "enableSorting": true }}
There is an "sortColumn" property that can be set for each column. But this does not do anything. - How to center align the header content? I have set "headerTextAlignment": "center" and
"textAlignment": "center" for each column in the "columnDefs" but the header-text and content itself is still aligned left. - How can I properly set the max height of the header? The option "MaxHeaderSize": "32px" does nothing. Using "maxHeight": 32 in {"columns": {"header":{}}} works halfway by affecting the wrong div-container. (See attached screenshot)
Also: When using conflicting max and minHeight settings for the rows, you get all kind of rendering errors and an unresponsive grid itself. I noticed that when using {"rows":{"maxHeight": 32}} which is 1px smaller than the default ptcs-div.row container.

