1 var
DepRecord
=
Ext.data.Record.create
2
([
3
{ name:
'
DdepSN
'
},
4
{ name:
'
DdepName
'
},
5
{ name:
'
DdepOffTel
'
},
6
{ name:
'
DdepExtTel
'
},
7
{ name:
'
DdepModTel
'
},
8
{ name:
'
DdepFax
'
},
9
{ name:
'
DdepMemo
'
},
10
{ name:
'
DdepShow
'
, type:
'
bool
'
},
11
{ name:
'
Pname
'
},
12
{ name:
'
_id
'
},
13
{ name:
'
_parent
'
},
14
{ name:
'
_level
'
},
15
{ name:
'
_lft
'
},
16
{ name:
'
_rgt
'
},
17
{ name:
'
_is_leaf
'
, type:
'
bool
'
},
18
{ name:
'
Timep
'
}
19
]);
//TreeGrid专用的Store
20
HyOA.FrmHRDepList.DepStore
=
new
Ext.ux.maximgb.treegrid.NestedSetStore
21
({
22
autoLoad:
true
,
23
url:
"
./Project/System/FrmDepListService.aspx?Param=GetAllDepNode&&isHRDep=true
"
,
24
reader:
new
Ext.data.JsonReader
25
({ id:
'
_id
'
, root:
'
data
'
, totalProperty:
'
total
'
, successProperty:
'
success
'
26
}, HyOA.FrmHRDepList.DepRecord)
27
});
28
var DepGrid
=
new
Ext.ux.maximgb.treegrid.EditorGridPanel
29
({
30
store: DepStore,
31
master_column_id:
'
DdepSN
'
,//重要属性。
32
region:
'
center
'
,
33
scope:
this
,
34
columns:
35
[
36
{ id:
'
DdepSN
'
, header:
"
部门编号
"
, dataIndex:
"
DdepSN
"
, width:
150
, sortable:
true
, editor:
new
Ext.grid.GridEditor(
new
Ext.form.TextField({ allowBlank:
false
})) },
37
{ header:
"
部门名称
"
, dataIndex:
"
DdepName
"
, width:
260
, sortable:
true
, editor:
new
Ext.grid.GridEditor(
new
Ext.form.TextField({ allowBlank:
false
})) },
38
{ header:
'
办公电话
'
, dataIndex:
'
DdepOffTel
'
, width:
130
, editor:
new
Ext.grid.GridEditor(
new
Ext.form.TextField({ allowBlank:
false
})) },
39
{ header:
'
电话分机
'
, dataIndex:
'
DdepExtTel
'
, width:
130
, editor:
new
Ext.grid.GridEditor(
new
Ext.form.TextField({ allowBlank:
false
})) },
40
{ header:
'
移动座机
'
, dataIndex:
'
DdepModTel
'
, width:
130
, editor:
new
Ext.grid.GridEditor(
new
Ext.form.DateField({ allowBlank:
false
})) },
41
{ header:
'
传真
'
, dataIndex:
'
DdepFax
'
, width:
130
, editor:
new
Ext.grid.GridEditor(
new
Ext.form.TextField({ allowBlank:
false
})) },
42
{ header:
"
备注
"
, width:
130
, sortable:
true
, dataIndex:
"
DdepMemo
"
, editor:
new
Ext.grid.GridEditor(
new
Ext.form.TextField()) },
43
{ dataIndex:
'
Timep
'
, hidden:
true
}
44
],
45
height:
220
,
46
sm:
new
Ext.grid.RowSelectionModel({ singleSelect:
true
}),
47
stripeRows:
true
,
48
enableDD:
true
,
49
title:
"
部门分类
"
,
50
viewConfig: { enableRowBody:
true
},
51
tbar: DepTBar
52
});