jQuery MiniUI

标题: grid翻页提示问题 [打印本页]

作者: xq286183401    时间: 2015-6-5 11:28:34     标题: grid翻页提示问题

[attach]6212[/attach]我做的这个页面,数据更新以后,想要翻页的时候做一个提示,有数据变更,是否保存,但是我写的这个方法弹出窗口是有了,但是照常翻页了
  1. function onbeforeload(e){
  2.                         var rows = grid.getChanges();       
  3.                         if (rows.length != 0) {
  4.                                 nui.showMessageBox({
  5.                             title: "系统提示",
  6.                             iconCls: "nui-messagebox-question",
  7.                             buttons: ["ok", "no", "cancel"],
  8.                             message: "有数据未保存是否继续?",
  9.                             callback: function (action) {
  10.                                 if(action == "ok")
  11.                                 {
  12.                                         save();
  13.                                 }
  14.                                 else if (action == "no")
  15.                                 {
  16.                                         e.cancel=false;
  17.                                 }else{
  18.                                         e.cancel=true;
  19.                                 }
  20.                             }
  21.                         });
  22.                         }
  23.                        
  24.                 }
复制代码



作者: dforce    时间: 2015-6-5 11:33:20

任何js模拟的弹出都不能阻塞代码
用原生的弹出提示

作者: xq286183401    时间: 2015-6-5 11:38:07

dforce 发表于 2015-6-5 11:33
任何js模拟的弹出都不能阻塞代码
用原生的弹出提示

明白~谢谢版主




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2