У меня что-то работает.Я использую такой форматер:
var observableFormatter = function(elLiner, oRecord, oColumn, oData) {
elLiner.innerHTML = oData();
};
И такой редактор:
var lang = YAHOO.lang;
YAHOO.namespace('SAMPLE');
YAHOO.SAMPLE.ObservableCellEditor = function(oConfigs) {
YAHOO.SAMPLE.ObservableCellEditor.superclass.constructor.call(this, oConfigs);
YAHOO.SAMPLE.ObservableCellEditor.prototype.resetForm = function() {
this.textbox.value = this.value();
};
YAHOO.SAMPLE.ObservableCellEditor.prototype.save = function() {
// Get new value
var inputValue = this.getInputValue();
var validValue = inputValue;
// validation code removed. Not needed for this sample.
var oSelf = this;
var finishSave = function(bSuccess, oNewValue) {
var oOrigValue = oSelf.value;
if (bSuccess) {
// Update observable with the new value
oSelf.value(oNewValue);
//trigger the data table to redraw
oSelf.getDataTable().updateCell(oSelf.getRecord(), oSelf.getColumn(), oSelf.value);
// Hide CellEditor
oSelf._hide();
oSelf.fireEvent("saveEvent", {
editor: oSelf,
oldData: oOrigValue,
newData: oSelf.value
});
}
else {
oSelf.resetForm();
oSelf.fireEvent("revertEvent", {
editor: oSelf,
oldData: oOrigValue,
newData: oNewValue
});
}
oSelf.unblock();
};
this.block();
if (lang.isFunction(this.asyncSubmitter)) {
this.asyncSubmitter.call(this, finishSave, validValue);
}
else {
finishSave(true, validValue);
}
};
};
YAHOO.lang.extend(YAHOO.SAMPLE.ObservableCellEditor, YAHOO.widget.TextboxCellEditor);
У меня есть живой пример:
http://jsfiddle.net/chrisschoon/pLPfw/