admin 管理员组文章数量: 1087135
2024年3月12日发(作者:用户登录界面的源码)
源代码:
加载到页面中的js文件
/********************************************************************
***********
* @author
* @since
* @description 双层表头
* @param{}
* mtext 表头名
* @param{}
* mcol 向后跨越子表头个数
* @param{}
* mwidth 上至下第一层表头的宽度,即父表头的宽度
* @class MyGridView
* @extends ew
*/
MyGridView = (ew, {
renderHeaders : function() {
var cm = , ts = tes;
var ct = , ct2 = ;
var cb = [], sb = [], p = {}, mcb = [];
for (var i = 0, len = umnCount(); i < len; i++)
{
= umnId(i);
= umnHeader(i) || "";
= umnStyle(i, true);
if ([i].align == 'right') {
= 'padding-right:16px';
}
cb[] = (p);
if ([i].mtext)
mcb[] = ({
value : [i].mtext,
0
mcols : [i].mcol,
mwidth : [i].mwidth
});
}
var s = ({
cells : (""),
tstyle : 'width:' + alWidth() + ';',
mergecells : ("")
});
return s;
}
});
viewConfig = {
templates : {
header : new te(
'
mhcell : new te(
'
style="width:{mwidth}px;">
"
}
};
修改grid的cm配置
var ldrk_cm = new Model([new berer({
mtext : " ",// 给父表头取的名字
mcol : 1,// 包含了几列
mwidth : 20,// 子表头宽度
width : 20,// 被包含子表头的宽度,最好填写一下
header : "No."
}), {
mtext : "本地住址
或",
mcol : 1,
mwidth : 190,
width : 200,
header : "
dataIndex : "address"
}, {
0
mtext : " ",
mcol : 1,
mwidth : 80,
width : 80,
header : "
sortable : true,
dataIndex : "name"
mtext : "
性",
mcol : 1,
mwidth : 30,
width : 30,
header : "
sortable : true,
dataIndex : "sex"
mtext : " ",
mcol : 1,
mwidth : 80,
width : 80,
header : "
dataIndex : "birthday"
mtext : " ",
mcol : 1,
mwidth : 80,
width : 90,
header : "
dataIndex : "marryDate"
mtext : " ",
mcol : 1,
mwidth : 100,
width : 110,
header : "
dataIndex : "moveAspect"
mtext : "流入人口填户籍地名
流出人口填流向地名",
mcol : 1,
mwidth : 200,
width : 200,
header : "
dataIndex : "placename"
}, {
}, {
}, {
}, {
}, {
}, {
0
mtext : "流入
(出)",
mcol : 1,
mwidth : 80,
width : 80,
header : "
dataIndex : "moveDate"
mtext : "离开
或返回",
mcol : 1,
mwidth : 80,
width : 80,
header : "
dataIndex : "comeDate"
mtext : "流入(出)
初期子女",
mcol : 2,
mwidth : 100,
width : 50,
header : "
dataIndex : "man"
width : 50,
header : "
dataIndex : "woman"
mtext : "流入(出)
初期避孕情况",
mcol : 2,
mwidth : 160,
width : 80,
header : "
dataIndex : "measureName"
width : 80,
header : "
dataIndex : "startDate"
mtext : "流动人口
婚育证明发验情况
mcol : 4,
mwidth : 320,
width : 80,
header : "
dataIndex : "certificateDate"
width : 80,
}, {
}, {
}, {
}, {
}, {
}, {
}, {
0
header : "
dataIndex : "checkDate"
width : 80,
header : "
dataIndex : "checkResult"
width : 80,
header : "
dataIndex : "certificateNo"
}, {
}, {
}]);
cm中设置完成后 还要在grid中调用之前提到的插件
其实很简单,只需要在grid中调用这句话话就可以了
view : new MyGridView(viewConfig)
0
发表评论