ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: conx on May 11, 2020, 09:47:56 am
-
I added a new column which is on string by default, so I need to change one of the columns to date format and other to the integer format from the front-end view, is there any functions on toolbar which can be used to dynamically change the data type of the column after its been created????
-
Please use getColumn method to get column and change its properties.
https://paramquery.com/pro/api#method-getColumn
listener: function () {
this.getColumn({dataIndx: dataIndx of field}).dataType = "integer";
}
-
i got it, this code can be done from backend but in spreadsheet/worksheet how can i select the column and have options to change the datatypes?
-
The above method is for changing dataType from toolbar and selected column's dataIndx or colIndx can be obtained from Selection().address() method.
https://paramquery.com/pro/api#method-Range
https://paramquery.com/pro/api#method-Selection
Alternatively it can also be done from context menu ( easier way ).
action: function (evt, ui) {
ui.column.dataType = "integer";
}