I have written a script that applies the createeditor
callback dynamically. However, I need to be able to determine which column the editor is being created on so I can apply custom settings to each of the cells that the editor is created on.
For example, my script will apply a jqxNumberInput to any columns that have {'columntype':'numberinput'}
set, but each column will have different settings for this such as decimal places etc. Resultantly, I need to know which column the cell is in so I can apply the relevant settings.
This is my code so far:
// Loop through each of the columns
for(var x in data.columns){
// If the column is a number input then apply the number input editor
if(data.columns[x].columntype=='numberinput'){
// Append the relevant column object with the createeditor callback
data.columns[x] = $.extend({
createeditor: function(row,cellvalue,editor){
editor.jqxNumberInput({
decimal: cellvalue,
inputMode: 'simple',
max: 99999999999999999999,
min: -99999999999999999999,
decimalDigits: data.columns[x].decimal_places, // THIS IS WHAT DOES NOT WORK
decimalSeparator: data.localization.decimalseparator,
digits: 20
});
}
},data.columns[x]);
}
}