:: Forum >>
Editing and getCellData
Hi,
I have noticed that when I edit a cell I can retrieve the value
with the function getCellText, but I can't do it with getCellData.
I need to read the value without formatting, so I think that the best choice is to read it from getCellData.
Why editing is not reflected on both methods?
How can I do that?
MP
Friday, June 16, 2006
The editing functionality is not completed yet and this is one of the missing parts. Basically you have to parse the cell text and put it into cell data property on 'cell validated' event.
obj.onCellValidated = function(text, col, row){
var format = this.getCellFormat(col, row);
var data = format ? format.textToData(text): text;
this.setCellData(data, col, row);
this.setCellText(undefined, col, row);
}
When using XML or CSV sources you'll have to add setData(value, col, row) method to the external table object.
var table = new AW.XML.Table;
...
table.setData = function(value, col, row){
var node = this.getNode(col, row);
if (AW.ie) {
node.text = value;
}
else {
node.textContent = value;
}
}
Alex (ActiveWidgets)
Friday, June 16, 2006
Thanks for your suggestion Alex!
I have another problem now!
I'm using ActiveWidgets 2.0.0 but the function textToData (system.format.js) does nothing:
obj.textToData = function(text){
return text;
};
I have also tried dataToValue and textToValue in formats.number.js.
These reverse formatting methods seem to work only with english format (#,###.).
If I apply italian settings "#.###," the edited values are parsed as english format, so the value is not converted correctly.
The insertion of 123,456 become 123456 and the insertion of 123.456.789 become NaN.
Is there another function that reverse formatting? How can I fix it?
Are there new features about this in ActiveWidgets 2.0.1?
MP
Friday, June 16, 2006
Hi,
how can I refresh the grid?
I have tried to call this.refresh(), but it lock further selection and editing.
I have also thought to skip refresh by formatting directly the data, but I don't have any idea to do it.
obj.onCellValidated = function(text, col, row){
var format = this.getCellFormat(col);
var data = format ? format.textToValue(text): text;
this.setCellData(data, col, row);
obj.refresh();
}
Thanks in advance,
MP
Monday, June 19, 2006
The text does not update in 2.0.0 (bug) but it is fixed in 2.0.1.
Alex (ActiveWidgets)
Monday, June 19, 2006
This topic is archived.
Back to support forum
Forum search