Oh… using a Dataset. Interesting.
I’m using table.data as an array of objects instead.
Here, I entered 1
in the population property using the Perspective Property Editor. By its orange color, we can see that it is typed as a number.
![image](https://global.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b19e16b88cf2f90ee115d404b96189fad23b2c5.png)
Then in preview mode, I edited the column and set 2
. It’s now colored as a string, green.
![image](https://global.discourse-cdn.com/inductiveautomation/original/3X/3/e/3ed8763f12a834b489cd6d657b4c6f641daeedcc.png)
I assumed that setting the render
prop in table.columns
to number
would change the cell editor to a numeric entry field, but I guess not ![:confused: :confused:](https://emoji.discourse-cdn.com/twitter/confused.png?v=12)
I’ll try using a DataSet.
table.columns
[
{
"field": "enabled",
"visible": true,
"editable": true,
"render": "auto",
"justify": "auto",
"align": "center",
"resizable": true,
"sortable": true,
"sort": "none",
"viewPath": "",
"viewParams": {},
"boolean": "checkbox",
"number": "value",
"progressBar": {
"max": 100,
"min": 0,
"bar": {
"color": "",
"style": {
"classes": ""
}
},
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": true,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"numberFormat": "0,0.##",
"dateFormat": "MM/DD/YYYY",
"width": "",
"strictWidth": false,
"header": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
},
"footer": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
},
"style": {
"classes": ""
}
},
{
"field": "date",
"visible": true,
"editable": true,
"render": "date",
"justify": "auto",
"align": "center",
"resizable": true,
"sortable": true,
"sort": "none",
"viewPath": "",
"viewParams": {},
"boolean": "checkbox",
"number": "value",
"progressBar": {
"max": 100,
"min": 0,
"bar": {
"color": "",
"style": {
"classes": ""
}
},
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": true,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"numberFormat": "0,0.##",
"dateFormat": "MM/DD/YYYY",
"width": "",
"strictWidth": false,
"header": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
},
"footer": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
},
"style": {
"classes": ""
}
},
{
"field": "population",
"visible": true,
"editable": true,
"render": "number",
"justify": "auto",
"align": "center",
"resizable": true,
"sortable": true,
"sort": "none",
"viewPath": "",
"viewParams": {},
"boolean": "checkbox",
"number": "value",
"progressBar": {
"max": 100,
"min": 0,
"bar": {
"color": "",
"style": {
"classes": ""
}
},
"track": {
"color": "",
"style": {
"classes": ""
}
},
"value": {
"enabled": true,
"format": "0,0.##",
"justify": "center",
"style": {
"classes": ""
}
}
},
"toggleSwitch": {
"color": {
"selected": "",
"unselected": ""
}
},
"numberFormat": "0,0.##",
"dateFormat": "MM/DD/YYYY",
"width": "",
"strictWidth": false,
"header": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
},
"footer": {
"title": "",
"justify": "left",
"align": "center",
"style": {
"classes": ""
}
},
"style": {
"classes": ""
}
}
]