重写保存按钮save事件

 1 _saveActionEventHandler:function(event,value){
 2             if (!_self.fireEvent("saveBefore")) return;
 3             var option = _self.getOptionFromArguments(arguments);
 4             _self.fireEvent("fieldOnStoreEvent");
 5                         //更改保存的数据
 6              _self._model.number = 123;
 7                         var editModel = waf.toJSONString(_self.getCurrentModel());
 8             option.action = "save";
 9             if (option&&option.data){
10                 option.data.model=editModel;            
11             }    
12             else{
13                 option.data = {
14                     model:editModel
15                 }
16             }
17             option.success = option&&option.success?option.success:function(objectPK){
18                 _self.showInfo(waf.dynamicEdit.info.savesuccess);
19                 document.location.href = listUrl;
20             }
21             waf.doPost(option);    
22         }
23     });
24     //注册数据保存事件 
25     _self.subscribeEvent("saveActionEvent", _private._saveActionEventHandler,"overwrite");​

 

posted @ 2016-10-31 19:45  suruozhong  阅读(1184)  评论(0编辑  收藏  举报