I’m facing a problem related to data processor and custom (readonly) Excel.
I have a custom Excel that I use to localize some data :
function eXcell_localize(cell){
if (cell){
this.cell = cell;
this.grid = this.cell.parentNode.grid;
}
this.edit = function(){}
this.isDisabled = function(){ return true; }
this.setValue=function(val){
this.setCValue(SOME_LOCALIZE_FUNCTION(val), val);
}
}
eXcell_localize.prototype = new eXcell;
All display fine.
But when I use dataprocessor to save new data (or update old one), dataprocessor send to my server the localized data (result of SOME_LOCALIZE_FUNCTION(val)) instead of the true value of the cell (val).
It is obviously a problem for me.
Am I doing things the wrong way ? Or is there a way to change this behaviour ?
After looking in the code, it seems that the second argument of setCValue is used for the “onCellChanged” event and is then discarded.
It seems wrong for me, a cell should have an internal value, and a “formatted” value, that is the way you render the internal value for the user. And dataprocessor should send the internal value to the serveur.
I solved the problem by redefining the getValue function, and saving the internal value