easyui

2015 / 07 / 20 easyui

远程验证

html 第二个参数是参数名

<input type="text" name="order.waybillNo"  class="easyui-validatebox" 
required="required" validType="remote['order/order!checkWaybillNo.action','waybillNo']"
invalidMessage="运单编号已存在"/>

java

public void checkWaybillNo(){
    String waybillNo = getRequest().getParameter("waybillNo");
    boolean flag =orderDao.selectByWayBillNo(waybillNo, companyId)==null;
    outputJson(flag);//返回true,false
}

loading框

直接从datagrid里面的源代码中的loading提取出来的。

function addLoad(){
        $("<div class=\"datagrid-mask\"></div>").css({display:"block",width:"100%",height:$(window).height()}).appendTo("body");
        $("<div class=\"datagrid-mask-msg\"></div>").html("正在处理,请稍候。。。").appendTo("body").css({display:"block",left:($(document.body).outerWidth(true) - 190) / 2,top:($(window).height() - 45) / 2});
    }
function removeLoad(){
    $(".datagrid-mask,.datagrid-mask-msg").remove();
}