var menuRec = Ext.create('secnedu.model.menu.menu',values) ; // create model...
this.getMenulist().getStore().insert( 0 ,menuRec ) ; // store add...
this.getMenulist().getStore().sync({
success : function ( batch ,option ){
console.log( 'success' ) ;
} ,
failure : function (){
console.log( 'failure...' ) ;
this.getMenulist().getStore().rejectChnages() ; // rollback...
} ,
scope : this
}) ;
在同步之后如何将 menuId 写入当前行的 menuId,我也不想再重新查询一遍啊...
this.getMenulist().getStore().insert( 0 ,menuRec ) ; // store add...
this.getMenulist().getStore().sync({
success : function ( batch ,option ){
console.log( 'success' ) ;
} ,
failure : function (){
console.log( 'failure...' ) ;
this.getMenulist().getStore().rejectChnages() ; // rollback...
} ,
scope : this
}) ;
在同步之后如何将 menuId 写入当前行的 menuId,我也不想再重新查询一遍啊...
if( operation.action == 'create' ){ //当是添加动作的时候,我们需要进行 (写入服务端id)
var resModel = Ext.decode(operation.response.responseText) ;
if( resModel.success == true ){
Ext.each(operation.records, function(record){
record.set( 'menuId' ,resModel.data.menuId ) ;
if ( record.dirty ) {
record.commit();
}
});
}
}
}