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(

'

style="{tstyle}">',

'

{mergecells} '

+ '

{cells}

',

"

"),

mhcell : new te(

'

style="width:{mwidth}px;">

{value}
',

" ")

}

};

修改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