晚上好球員,重命名並插入埃羅TreeStore ExtJS的4.1.1
當我更新它不保存所有的模型的項目,如「tipoNo」和「拍」的方法。有人知道我能做什麼?
請求負載
這是在請求發送的信息。
{"parentId":1,"nome":"qwfqwfqw"}
型號:在我的模型
領域。
fields : [ {
name : 'id',
type : 'long'
},{
name : 'pai',
type : 'long'
}, {
name : 'nome',
type : 'string'
}, {
name : 'tipoNo',
type : 'string'
}, {
name : 'leaf',
type : 'boolean',
convert : function(value, record) {
var no = record.get('tipoNo');
return (no == "CLIENTE" ? true : false);
}
} ],
代理
代理服務器上必要的信息。
proxy : {
type : 'rest',
url : Webapp.link('node'),
reader : {
type : 'json',
root : 'nodes',
idProperty : 'id'
},
writer : {
type : 'json',
writeAllFields : false
}
}
控制器方法
/**
* Rename
*
* @param {Ext.grid.plugin.CellEditing} editor
* @param {Object} e
*/
updateList : function (editor, e) {
var node = e.record;
node.save({
success: function(list, operation) {
console.log("updated");
},
failure: function(list, operation) {
var error = operation.getError(),
msg = Ext.isObject(error) ? error.status + ' ' + error.statusText : error;
Ext.MessageBox.show({
title: 'Notificação',
msg: msg,
icon: Ext.Msg.ERROR,
buttons: Ext.Msg.OK
});
}
});
},
我試着這樣做,但是當我發信息,我有序列化的問題。 –