|
对话框infodetail.w返回数据到主窗口的代码:- Model.prototype.backBtnClick = function(event){
- alert('info_id='+window.id);
- this.comp("windowReceiver1").windowEnsure({data:{i:window.i,id:window.id,}});
- };
复制代码
主窗口infolist.w接受端代码:
- Model.prototype.windowDialog1Receive = function(event){
- alert('i='+event.data.data.i);
- alert('id='+event.data.data.id);
- var data = this.comp('infoData');
- debugger;
- var e = data.getValue('enjoy_count');
- var h =data.getValue('hate_count');
- var i =Number(event.data.data.i);
- e=e+i;
- h=h-i;
- data.setValue('enjoy_count',e);
- data.setValue('hate_count',h);
- data.saveData();
- alert('e='+data.getValue('enjoy_count')); <font color="#ff8c00"> //读出来是对的</font>
- alert('h='+data.getValue('hate_count')); <font color="#2e8b57"> //这个也对</font>
复制代码 如下图,在调试的时候都是对的。再次从infolist点击进去对应的infodetail,数据还是对的,就是数据库没有修改,setValue和savedata都不起作用。感觉是修改了infodetail的那个data里的数据(因为再次打开时数值是对的),如何才能修改数据库的值???
|
|