关于jsp发起请求加载datagrid数据(草稿)

 

$(document).ready(function (){
        var refNo = '${refNo}';
        $('#caAbnDetail').datagrid('load',{
            refNo:refNo
        });
        //下面这种请求方式:datagrid中的field属性值为null
        /*$.ajax({
             type:"POST",
             url:"caReconController.do?getAbnDetail",
             cache: false,
             data:{refNo:refNo},
             dataType: 'json',
             success:function(result){
                 /!*var jsondata2 = result;
                 var data = $.parseJSON(jsondata2); //json格式化
                 alert(jsondata2);//未初始化
                 $("#dg").datagrid('loadData', data);//加载数据,不加表格数据不会显示*!/
             },
             error:function(){
                alert("error");
             }
         });*/
    });

 

function targetCustomersearch() {
    try {
        if (!$("#targetCustomer").Validform({tiptype: 3}).check()) {
            return false;
        }
    } catch (e) {
    }
    if (true) {
        var queryParams = {};
        var flag = true;
        $('#targetCustomertb').find('*').each(function () {
            if ($(this).attr('name') == 'accNo') {
                var accNo = $(this).val();
                if (!accNo) {
                    var nextElement = $(this).next();
                    if (!$(this).next().hasClass("Validform_checktip Validform_wrong")) {
                        $(this).after("<span class='Validform_checktip'></span>");
                        $(".Validform_checktip:last").addClass("Validform_wrong").text("Account Number can't be empty");
                    }
                    flag = false;
                }
            }
            queryParams[$(this).attr('name')] = $(this).val();
        });
        if (!flag) {
            return false;
        }
        $('#targetCustomer').datagrid({
            url: 'customerInfoController.do?getCustomerInfoToCreditTransfer&field=accNo,nric,name,meterInfoEntity.meterId,acctBalEntity.balance,mobileNumber,openDate,type,address,streetName,',
            pageNumber: 1,
            queryParams: queryParams
        });
    }
}

 

posted @ 2018-09-20 13:43  习惯沉淀  阅读(315)  评论(0编辑  收藏  举报