DWZ的列表扩展
/Files/jiangguanghe/jquery.table.rar
针对DWZ.js写了一个列表扩展JS功能,仿照JqGrid的用法写的,方便列表绑定
详细用法如下:
function bandList() {
var unitName = $("#txtAcceptUnit").val();
var userName = $("#txtAcceptUserName").val();
var certType = $("#txtAcceptCertificateType").attr("certtype");
var certCode = $("#txtAcceptCertificateCode").val();
var startTime = $("#txtAcceptStartTime").val();
var endTime = $("#txtAcceptEndTime").val();
if (typeof (certType) == "undefined")
certType = 0;
var param = { colNames: [
{ name: 'HyperID', text: 'hyperId', hidden: true, key: true },
{ name: 'UserName', width: 200, text: '用户名' },
{ name: 'CertificateType', width: 150, text: '证件类型' },
{ name: 'CertificateCode', width: 150, text: '证件号码' },
{ name: 'WorkUnit', width: 250, text: '单位' },
{ name: 'Number', width: 80, text: '数量' },
{ name: 'CreateDate', width: 100, text: '时间' }
],
isShowError: true,//是否显示错误信息
url: getControllerUrl("Accept", "GetAcceptingList"), //请求访问的地址
postData: { unitName: unitName, userName: userName, certType: certType, certCode: certCode, startTime: startTime, endTime: endTime } //请求的参数
};
$("#pagerAcceptList").dwzTable(param); //调用方法
}
var unitName = $("#txtAcceptUnit").val();
var userName = $("#txtAcceptUserName").val();
var certType = $("#txtAcceptCertificateType").attr("certtype");
var certCode = $("#txtAcceptCertificateCode").val();
var startTime = $("#txtAcceptStartTime").val();
var endTime = $("#txtAcceptEndTime").val();
if (typeof (certType) == "undefined")
certType = 0;
var param = { colNames: [
{ name: 'HyperID', text: 'hyperId', hidden: true, key: true },
{ name: 'UserName', width: 200, text: '用户名' },
{ name: 'CertificateType', width: 150, text: '证件类型' },
{ name: 'CertificateCode', width: 150, text: '证件号码' },
{ name: 'WorkUnit', width: 250, text: '单位' },
{ name: 'Number', width: 80, text: '数量' },
{ name: 'CreateDate', width: 100, text: '时间' }
],
isShowError: true,//是否显示错误信息
url: getControllerUrl("Accept", "GetAcceptingList"), //请求访问的地址
postData: { unitName: unitName, userName: userName, certType: certType, certCode: certCode, startTime: startTime, endTime: endTime } //请求的参数
};
$("#pagerAcceptList").dwzTable(param); //调用方法
}
后台是直接返回JSON格式列表就可以了,只要ColNames里的name与Json里的对应上就会显示出来了,
这个列表绑定不需要查询总行数,也不会对总行数进行任何计算