this is my first question here, I decided to write because I'm going crazy with this.
I'm working with jQuery handsontable and I'm trying to set colour of specific column. The problem with this is that this column never has the same index, because the data it's loaded from database. Well I think I can do it with cells function when I initialize handsontable.
cells: function (row, col, prop) {
var cellProperties = {};
if (prop==="matsvalue") {
cellProperties.renderer = totalesRenderer; // uses function directly
}
return cellProperties;
}
The question is. If I have a column defined with data: "matsvalue". Can I reference this with prop parameter?
Renderer it's working if I do this,
cells: function (row, col, prop) {
var cellProperties = {};
if (row===5) {
cellProperties.renderer = totalesRenderer; // uses function directly
}
return cellProperties;
}
row number 5 takes renderer
I get the columns from database saving it in a JS Object and pushing it to handsontable columns like this.
var col2 = new Object();
col2.data = "matsvalue";
col2.title = "Mats Value";
col2.width = "200";
col2.readOnly = "true";
col2.renderer = totalesRenderer;
it takes data, and title, but width readonly and renderer option is not working.