首页 > 代码库 > 重写保存按钮save事件

重写保存按钮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 =http://www.mamicode.com/ {
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 =http://www.mamicode.com/ listUrl;
20             }
21             waf.doPost(option);    
22         }
23     });
24     //注册数据保存事件 
25     _self.subscribeEvent("saveActionEvent", _private._saveActionEventHandler,"overwrite");?

 

重写保存按钮save事件