dhtmlxTreeGrid详解编程语言

最终效果(只添加了一级子树,可以根据需求增加级数,方法在后面)。
QQ图片20140423095741

HTML和js代码

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<title>Insert title here</title> 
<link href="../gridtest/dhtmlxgrid.css" rel="STYLESHEET" type="text/css" /> 
<link href="../gridtest/skins/dhtmlxgrid_dhx_skyblue.css" rel="STYLESHEET" type="text/css" /> 
<script type="text/javascript" src="../gridtest/dhtmlxcommon.js"></script> 
<script type="text/javascript" src="../gridtest/dhtmlxgrid.js"></script> 
<script type="text/javascript" src="../gridtest/dhtmlxgridcell.js"></script> 
<script  src="../gridtest/dhtmlxtreegrid.js"></script> 
</head> 
<body> 
<div id="gridbox" style="width:570px;height:137px;background-color:white;"></div> 
<script> 
mygrid = new dhtmlXGridObject('gridbox'); 
mygrid.selMultiRows = true; 
mygrid.imgURL = "../gridtest/imgs/icons_greenfolders/"; 
// mygrid.setHeader("#master_checkbox,模板名称,所属系统,条件名称,过程名,有效时长,修改时间,操作,#cspan"); 
            mygrid.setHeader(" ,模板名称,所属系统,条件名称,过程名,有效时长,修改时间,操作,#cspan"); 
mygrid.setInitWidths("42,120,120,280,280,70,110,80,*");//设置列宽度 
            mygrid.setColAlign("center,left,left,left,left,left,left,left,left");//这是列内容的对齐方式 
            mygrid.setColTypes("ch,tree,ro,ro,ro,ro,ro,ro,ro"); 
mygrid.setSkin("dhx_skyblue");//设置皮肤 
            mygrid.enableAutoHeigth(true,220); 
mygrid.enableRowsHover(true,"hover");//设置鼠标移动到某一行上的样式z 
            mygrid.setColSorting("int,str,str,str,str,str,str,str,str");//点击header排序 
            mygrid.enableEditEvents(false, false, false);//是否禁用编辑,单击/双击/按F2键,这里全部禁用 
            mygrid.init(); 
// mygrid.kidsXmlFile = "../gridtest/test_list_2.xml"; 
            mygrid.loadXML("../gridtest/test_list_1.5.xml"); 
</script> 
</body> 
</html>

XML数据代码test_list_1.5.xml

<?xml version="1.0" encoding="UTF-8"?> 
<rows> 
<row id="honda" selected="1" call="1" xmlkids="1"> 
<cell/> 
<cell image="folder.gif">Honda</cell> 
</row> 
<row id="bmw"> 
<cell/> 
<cell image="folder.gif">BMW</cell> 
<cell>30,800</cell> 
<cell>30,800</cell> 
<cell>30,800</cell> 
<cell>30,800</cell> 
<row id="head"> 
<cell/> 
<cell image="blanc.gif"></cell> 
<cell>价格</cell> 
<cell>排量</cell> 
<cell>qwe</cell> 
<cell>qwe</cell> 
</row> 
<row id="bmw1"> 
<cell/> 
<cell image="blanc.gif"></cell> 
<cell>30,800</cell> 
<cell>2.5L</cell> 
</row> 
<row id="bmw2"> 
<cell/> 
<cell image="blanc.gif"></cell> 
<cell>47,100</cell> 
<cell>3.2L</cell> 
<cell>333</cell> 
<cell>16</cell> 
<cell>24</cell> 
</row> 
</row> 
<row id="vw"> 
<cell/> 
<cell image="folder.gif">Volkswagen</cell> 
<row id="vw1"> 
<cell/> 
<cell>Colf GL 2.0</cell> 
<cell>15,580</cell> 
<cell>2.0L</cell> 
<cell>115</cell> 
<cell>24</cell> 
<cell>30</cell> 
</row> 
</row> 
<row id="mazda"> 
<cell/> 
<cell image="folder.gif">Mazda</cell> 
<row id="mazda1"> 
<cell/> 
<cell>MX-5 Miata</cell> 
<cell>21,868</cell> 
<cell>1.8L</cell> 
<cell>142</cell> 
<cell>22</cell> 
<cell>28</cell> 
</row> 
</row> 
<row id="porsche"> 
<cell/> 
<cell image="folder.gif">Porsche</cell> 
<row id="porsche1"> 
<cell/> 
<cell>Porsche 911</cell> 
<cell>128,200</cell> 
<cell>3.6L</cell> 
<cell>415</cell> 
<cell>14</cell> 
<cell>22</cell> 
<cell>4.06</cell> 
<cell>12.31</cell> 
<cell>120.63</cell> 
<cell>119</cell> 
</row> 
</row> 
</rows>

 

rows节点下面是多个row节点,表示有多个行,每个row下面有多个cell节点,表示多个列。

rows–|

            |

            |—row—|

                            |

                            |—cell

这样的结构和dhtmlxGrid数据一样,表示只有表格的行列数据,没有子级数据。

每个row节点下面的row节点就是树结构的子节点了,row1-1就是row1的子节点

如果想构造多级树结构就继续在row1-1节点下添加row1-1-1节点就可以了。

rows–|

            |

            |—row1—|

                              |

                              |—cell

                              |—row1-1—|

                                                    |

                                                    |—cell

 

 

dhtmlxgrid.css

div.gridbox{ 
overflow:hidden; 
text-align:left; 
} 
.dhx_sub_row 
{ 
background-color:white; 
} 
div.gridbox .xhdr{ 
background-color:#D4D0C8; 
} 
div.gridbox table.obj{ 
height:1px; 
} 
div.gridbox table.hdr td { 
line-height:normal; 
font-family:arial; 
font-size:12px; 
background-Color:#D4D0C8; 
border: 1px solid; 
border-color : white Gray Gray white; 
text-align: center; 
margin:0px; 
padding:5px 0px 5px 0px ; 
font-weight:normal; 
-moz-user-select:none;     
-moz-user-select:-moz-none;     
overflow:hidden; 
empty-cells:show; 
} 
div.gridbox table.hdr td div.hdrcell{ 
overflow:hidden; 
} 
div.gridbox table.obj td { 
border: 1px solid; 
border-color : white Gray Gray white; 
font-family:Arial; 
font-size:12px; 
-moz-user-select:none; 
-moz-user-select:-moz-none;    
overflow:hidden; 
padding-top:0px; 
padding-bottom:0px; 
empty-cells:show; 
} 
div.gridbox table.obj th, div.gridbox table.hdr th{ 
padding:0px 0px 0px 0px ; 
margin:0px 0px 0px 0px ; 
} 
div.gridbox table.row20px tr  td{ 
line-height:24px; 
white-space: nowrap; 
padding:0px; 
} 
div.gridbox .objbox { 
background-color:white; 
position:relative; 
-webkit-overflow-scrolling: touch; 
} 
div.gridbox table.obj td span.space, div.gridbox table.obj td img.space{ 
width:18px; 
} 
div.gridbox table.obj tr.rowselected td.cellselected, div.gridbox table.obj td.cellselected { 
background-color:#d8d8d8; 
color:black; 
} 
div.gridbox table.obj tr.rowselected td{ 
background-color:#e1e0d7; 
color:black; 
} 
div.gridbox table.obj td.editable{ 
-moz-user-select:text; 
} 
div.gridbox table.obj td.group_row{ 
vertical-align:middle; font-family:Tahoma; font-size:10pt; font-weight:bold; height:30px;  border:0px;  border-bottom: 2px solid navy;  
}     
.dragSpanDiv{     font-size : 12px;     border: 1px gray solid; background-color:white; z-index:999; } 
.dhx_combo_select{ 
font-family:arial; 
font-size:12px; 
border:1px solid; 
border-color:black silver silver black; 
background-color:white; 
overflow:hidden; 
cursor:default; 
position:absolute; 
height:auto; 
z-index:600; 
} 
.dhx_combo_edit{ 
width:100%; 
border:0px; 
padding:0px; 
padding-right:1px !ie; 
margin:0px; 
font:12px arial; 
overflow:hidden; 
} 
.dhx_textarea{ 
border:1px solid; 
border-color:black silver silver black; 
position:absolute; 
height:100px; 
z-index:600; 
} 
.dhx_clist{ 
background-color:white; 
border:1px solid black; 
padding:2px 2px 2px 2px; 
z-index:300; 
} 
.gridDragLine{ 
position:absolute; 
top:10px; left:0px; 
width:100%; 
height:2px; 
background-color:black; 
overflow:hidden; 
} 
/*paginal output*/ 
div.pagingBlock{ 
font-size:12px; 
font-family:verdana,arial; 
} 
div.pagingBlock .pagingCurrentPage{ 
font-weight:bold; 
cursor:default; 
} 
div.pagingBlock .pagingPage{ 
cursor:pointer; 
text-decoration:underline; 
} 
span.recordsInfoBlock { 
font-size:12px; 
font-family:verdana,arial; 
} 
div.pagingBlock a{ 
text-decoration:none; 
padding-right:2px; 
color:black; 
cursor:pointer; 
} 
div.pagingBlock a.dhx_not_active{ 
text-decoration:none; 
cursor:default; 
} 
/*class for toolbar selectbox. used with pagingWT*/ 
.toolbar_select{ 
font-size:10px; 
} 
/*block selection style*/ 
.dhtmlxGrid_selection { 
-moz-opacity: 0.5; 
filter: alpha(opacity = 50); 
background-color:yellow; 
opacity:0.5; 
border: 1px dotted black; 
} 
/* xp skin ------------------------------------------------------*/ 
div.gridbox_xp{ 
border:1px solid lightgrey; 
} 
div.gridbox_xp .xhdr{ 
background-image:url('imgs/header_bg_60.gif'); 
} 
div.gridbox_xp table.hdr td { 
color:#616161; 
background-image:url('imgs/header_bg_60.gif'); 
border:0px; 
text-align: center; 
margin:0px; 
padding:5px 0px 5px 0px ; 
font-weight:bold; 
-moz-user-select:none; 
-moz-user-select:-moz-none;     
overflow:hidden; 
} 
div.gridbox_xp table.hdr td div.hdrcell{ 
border-left: 1px solid white; 
border-right: 1px solid gray; 
height:16px; 
white-space : nowrap; 
font-family:Arial; 
font-size:12px; 
} 
div.gridbox_xp table.obj td { 
border:0px; 
border-bottom: 1px solid lightgrey; 
border-right: 1px solid lightgrey; 
font-family:Arial; 
font-size:12px; 
-moz-user-select:none; 
-moz-user-select:-moz-none;     
overflow:hidden; 
padding-top:0px; 
padding-bottom:0px; 
} 
div.gridbox_xp table.obj tr.rowselected td{ 
background-color:whitesmoke; 
color:black; 
} 
div.gridbox_xp table.obj tr.rowselected td.cellselected, div.gridbox_xp table.obj td.cellselected { 
background-color:whitesmoke; 
} 
div.gridbox_xp table.row20px tr  td{ 
height:22px; 
white-space: nowrap; 
padding:1px; 
} 
/* gray skin --------------------------------------------------*/ 
div.gridbox_gray { 
border:1px solid gray; 
background-color:#D4D0C8; 
} 
/* mt skin ------------------------------------------------------*/ 
div.gridbox_mt{ 
border:1px solid lightgrey; 
} 
div.gridbox_mt .dhx_sub_row 
{ 
background-color:transparent; 
} 
div.gridbox_mt .xhdr{ 
background-image:url('imgs/header_bg.gif'); 
} 
div.gridbox_mt .xhdr_last{ 
border:0px; 
border-bottom: 1px solid lightgrey; 
border-left: 1px solid lightgrey; 
} 
div.gridbox_mt table.hdr td { 
color:#616161; 
border:0px; 
border-bottom: 1px solid lightgrey; 
border-left: 1px solid lightgrey; 
text-align: center; 
margin:0px; 
background-image:url('imgs/header_bg.gif'); 
padding: 0px 0px 0px 0px; 
-moz-user-select:none; 
-moz-user-select:-moz-none;     
overflow:hidden; 
} 
div.gridbox_mt table.hdr td div.hdrcell{ 
height:16px; 
white-space : nowrap; 
font-family:Verdana; 
font-size:12px; 
} 
div.gridbox_mt table.obj td { 
border:0px; 
border-bottom: 1px solid lightgrey; 
border-right: 0px solid lightgrey; 
font-family:Verdana; 
font-size:12px; 
-moz-user-select:none; 
-moz-user-select:-moz-none;     
overflow:hidden; 
padding-top:0px; 
padding-bottom:0px; 
} 
div.gridbox_mt table.obj tr.rowselected td{ 
background-color:#D6D3FA; 
color:black; 
} 
div.gridbox_mt table.obj tr.rowselected td.cellselected, div.gridbox_mt table.obj td.cellselected { 
background-color:#D6D3FA; 
} 
div.gridbox_mt table.row20px tr  td{ 
height:22px; 
white-space: nowrap; 
padding:1px; 
} 
/*------------------------------------------------------------*/ 
div.gridbox div.ftr{ 
position:absolute; 
left:0px; 
bottom:1px; 
width:100%; 
overflow:hidden; 
} 
div.gridbox div.ftr td { 
padding:0px; 
padding-left:10px; 
padding-right:5px; 
border-top:1px solid gray; 
border-right:1px solid gray; 
background-color:#ffffcc; 
font-style : italic; 
font-family:arial; 
font-size:12px; 
overflow:hidden; 
} 
div.gridbox table.hdr td.columnTargetR div.hdrcell{ 
border-right:3px double #FF6600; 
border-left:3px solid #D4D0C8; 
} 
div.gridbox table.hdr td.columnTargetL div.hdrcell{ 
border-right:3px solid #D4D0C8; 
border-left:3px double #FF6600; 
} 
.dhx_dragColDiv{ 
font-family:Arial; 
font-size:12px; 
background-color:#D4D0C8; 
border: 1px solid; 
border-color : white Gray Gray white; 
text-align: center; 
margin:0px; 
padding:5px 20px 5px 20px ; 
font-weight:normal; 
filter:alpha(opacity:75); 
-moz-opacity:0.75; 
opacity:0.75; 
} 
/*light*/ 
div.gridbox_light { 
border:1px solid  #c2d5dc; 
} 
div.gridbox_light .xhdr{ 
background-image:url(imgs/skin_light_header.png); 
} 
div.gridbox_light .xhdr_last{ 
border: 1px solid; 
border-color : #FDFDFD #93AFBA #93AFBA #FDFDFD; 
} 
div.gridbox_light table.hdr{ 
background-image:url(imgs/skin_light_header.png); 
} 
div.gridbox_light table.hdr td { 
border: 1px solid; 
border-color : #FDFDFD #93AFBA #93AFBA #FDFDFD; 
background-color:transparent; 
font-family:Tahoma; 
font-size:11px; 
font-weight:bold; 
color:#055A78; 
vertical-align:top; 
text-align:left; 
} 
div.gridbox_light table.hdr td div.hdrcell{ 
width:auto; 
padding-left:10px; 
} 
div.gridbox_light table.hdr .filter{ 
padding-left:0px !important; 
text-align:center; 
-moz-user-select:text; 
} 
div.gridbox_light table.obj td { 
border-width: 0px 1px 0px 1px; 
border-left: 1px solid white; 
border-right: 1px solid #D6D6D6; 
font-family:Tahoma; 
font-size:11px; 
padding-right:4px; 
padding-left:4px; 
} 
div.gridbox_light table.obj{ 
border-bottom: 1px solid #D6D6D6; 
} 
div.gridbox_light table.row20px tr td { 
padding-right:4px; 
padding-left:4px; 
} 
div.gridbox_light .dhx_combo_edit{ 
font-family:Tahoma; 
font-size:11px; 
} 
div.gridbox_light table.obj tr.rowselected td{ 
background-color:#ededed; 
color:black; 
} 
div.gridbox_light table.obj tr.rowselected td.cellselected, div.gridbox_light table.obj td.cellselected { 
background-color:#ededed; 
} 
div.gridbox_light .odd_light{ 
background-color:#E5F2F8; 
} 
div.gridbox_light div.ftr td { 
empty-cells:show; 
} 
/*modern*/ 
div.gridbox_modern { 
border:1px solid  #D6D6D6; 
} 
div.gridbox_modern .dhx_sub_row 
{ 
background-color:transparent; 
} 
div.gridbox_modern .xhdr{ 
background-image:url(imgs/skin_modern_header.png); 
} 
div.gridbox_modern .xhdr_last{ 
border: 1px solid; 
border-color : #FDFDFD #B5B5B5 #B5B5B5 #FDFDFD; 
} 
div.gridbox_modern table.hdr{ 
background-image:url(imgs/skin_modern_header.png); 
} 
div.gridbox_modern table.hdr td { 
border-right:1px solid #B5B5B5; 
border-left:1px solid #FDFDFD; 
border-top:1px solid #FDFDFD; 
border-bottom:1px solid #B5B5B5; 
background-color:transparent; 
font-family:Tahoma; 
font-size:11px; 
font-weight:bold; 
color:#055A78; 
vertical-align:top; 
text-align:left; 
} 
div.gridbox_modern table.hdr td div.hdrcell{ 
width:auto; 
padding-left:10px; 
} 
div.gridbox_modern table.hdr .filter{ 
padding-left:0px !important; 
text-align:center; 
} 
div.gridbox_modern table.obj td { 
border: 0px solid; 
font-family:Tahoma; 
font-size:11px; 
padding-right:4px; 
padding-left:4px; 
} 
div.gridbox_modern table.row20px tr td { 
padding-right:4px; 
padding-left:4px; 
} 
div.gridbox_modern .dhx_combo_edit{ 
font-family:Tahoma; 
font-size:11px; 
} 
div.gridbox_modern table.obj tr.rowselected td{ 
background-color:#9ac2e5; 
color:black; 
} 
div.gridbox_modern table.obj tr.rowselected td.cellselected, div.gridbox_modern table.obj td.cellselected { 
background-color:#9ac2e5; 
} 
div.gridbox_modern .odd_modern{ 
background-color:#EDEDED; 
} 
div.gridbox_modern div.ftr td { 
padding:0px; 
padding-left:10px; 
padding-right:5px; 
border-top:0px solid gray; 
border-right:0px solid gray; 
background-color:#ffffcc; 
font-style : italic; 
font-family:arial; 
font-size:12px; 
} 
/*clear*/ 
div.gridbox_clear .xhdr{ 
background-color:transparent; 
} 
div.gridbox_clear div.topMumba{ 
position:absolute; 
left:0px; 
width:100%; 
height:3px; 
background-image:url(imgs/skinC_header.png); 
overflow:hidden; 
padding:0px; 
margin:0px; 
} 
div.gridbox_clear div.bottomMumba{ 
position:absolute; 
left:0px; 
width:100%; 
height:3px; 
background-image:url(imgs/skinD_header.png); 
overflow:hidden; 
} 
div.gridbox_clear div.bottomMumba img,div.gridbox_clear div.topMumba img{ 
border:0px; 
position:absolute; 
top:0px; 
} 
div.gridbox_clear{ 
padding-left: 10px; 
padding-right: 10px; 
} 
div.gridbox_clear table.hdr td { 
border:0px; 
background-color:transparent; 
font-family:Tahoma; 
font-size:11px; 
font-weight:bold; 
color:#055A78; 
vertical-align:top; 
text-align:left; 
} 
div.gridbox_clear table.hdr td div.hdrcell{ 
width:auto; 
padding-left:10px; 
padding-bottom:2px; 
} 
div.gridbox_clear table.hdr .filter{ 
padding-left:0px !important; 
text-align:center; 
} 
div.gridbox_clear table.obj td { 
border-width:  0px 1px 0px 0px ; 
border-color:#D6D6D6; 
font-family:Tahoma; 
font-size:11px; 
padding-right:4px; 
padding-left:4px; 
} 
div.gridbox_clear table.row20px tr td { 
padding-right:4px; 
padding-left:4px; 
} 
div.gridbox_clear .dhx_combo_edit{ 
font-family:Tahoma; 
font-size:11px; 
} 
div.gridbox_clear .odd_clear{ 
background-color:#E5F2F8; 
} 
div.gridbox_clear div.ftr td { 
padding:0px; 
padding-left:10px; 
padding-right:5px; 
border-top:1px solid gray; 
border-right:0px solid gray; 
background-color:#ffffcc; 
font-style : italic; 
font-family:arial; 
font-size:12px; 
} 
/*sb dark*/ 
div.gridbox_sbdark .objbox { 
background: #313131 !important; 
} 
div.gridbox_sbdark .xhdr{ 
background-color:#313131; 
} 
div.gridbox_sbdark .xhdr_last{ 
border: 1px solid; 
border-color : #474948 #202220 #202220 #202220; 
} 
div.gridbox_sbdark {       
background: #313131 !important;  
} 
div.gridbox_sbdark table { 
border-collapse: collapse; 
} 
div.gridbox_sbdark table.hdr tr  { 
border-top: 1px solid #202220; 
} 
div.gridbox_sbdark table.hdr,  
div.gridbox_sbdark table.hdr td { 
border-right:1px solid #202220; 
border-left:1px solid #202220; 
border-top: 1px solid #474948; 
border-bottom:1px solid #202220; 
background-color: #313131; 
font-size:11px;  
color:#8A8F84; 
vertical-align:top; 
text-align:left; 
padding: 2px 5px; 
} 
div.gridbox_sbdark .hdrcell { 
padding-left: 0px !important; 
font-family: 'Lucida Sans Unicode','Tahoma';  
} 
div.gridbox_sbdark table.hdr td div.hdrcell{ 
width:auto; 
padding-left:10px; 
} 
div.gridbox_sbdark table.obj td { 
border-width: 0px 1px 0px 1px; 
border-left: 1px solid #202220; 
border-right: 1px solid #EDF3F0; 
font-family: 'Consolas','Lucida Sans Unicode','Tahoma'; 
font-size:11px;     
} 
div.gridbox_sbdark table.row20px tr td { 
padding: 0px 5px !important;  
text-indent:1px; 
} 
div.gridbox_sbdark .dhx_combo_edit{ 
font-family: 'Lucida Sans Unicode','Tahoma'; 
font-size:11px; 
} 
div.gridbox_sbdark table.obj tr.rowselected td,  
div.gridbox_sbdark table.obj tr:hover,  
div.gridbox_sbdark .odd_light:hover { 
background-color: #8A8F84; 
color: white !important; 
} 
div.gridbox_sbdark table.obj tr.rowselected td.cellselected ,  
div.gridbox_sbdark table.obj td.cellselected { 
background-color:#8A8F84; 
} 
div.gridbox_sbdark .cellselected { 
background-color: #6e6f64 !important;     
} 
div.gridbox_sbdark .ev_sbdark { 
background-color: #FFFFFF; 
} 
div.gridbox_sbdark .odd_sbdark { 
background-color:#EDF3F0; 
}  
.dhtmlx_live_validation_error{ 
background-color:#FFE0E0 !important; 
} 
.dhtmlx_validation_error{ 
border-bottom:2px solid red !important; 
} 
.dhx_header_cmenu{ 
background-color:#ffffff; 
border:2px outset silver; 
z-index:2; 
} 
.dhx_header_cmenu_item{ 
white-space:nowrap; 
} 
div.gridbox_dhx_skyblue div.ftr td{ 
text-align:center; 
background-image:url(./imgs/sky_blue_grid.gif); 
border-bottom-color:#a8d8eb; 
border-right-color:#A4BED4; 
border-left-color:#FFFFFF; 
} 
div.gridbox td.filter input, div.gridbox td.filter select{ 
width:90%; font-size:8pt; font-family:Tahoma; -moz-user-select:text; 
}

dhtmlxgrid_dhx_skyblue.css

div.gridbox_dhx_skyblue .ftr, div.gridbox_dhx_skyblue .xhdr{ 
background-image:url(../imgs/sky_blue_grid.gif);     
} 
div.gridbox_dhx_skyblue table.hdr tr{ 
background-image:url(../imgs/sky_blue_grid.gif); 
background-position:0px -1px/9; 
} 
body:nth-of-type(1) div.gridbox_dhx_skyblue table.hdr tr{ 
background-image:url(../imgs/sky_blue_grid.gif); 
background-position:0px -1px; 
} 
div.gridbox_dhx_skyblue table.obj tr td{ 
font-family:SimSun; 
font-size:12px; 
border-width:0px 0px 0px 0px; 
border-bottom:1px dotted #a8d8eb; 
border-right:1px solid #A4BED4; 
border-left:1px solid #FFFFFF; 
padding-right:4px; 
padding-left:4px; 
} 
div.gridbox_dhx_skyblue table.obj tr:hover{ 
background-color:#FFFFBB; 
} 
div.gridbox_dhx_skyblue table.hdr td div.hdrcell{ 
width:auto; 
} 
html > body /**/ div.gridbox_dhx_skyblue table.hdr td div.hdrcell{ 
/*width:100%;*/ 
} 
div.gridbox_dhx_skyblue table.hdr td { 
border-width: 1px 1px 1px 1px; 
border-color : #FDFDFD #A4BED4 #A4BED4 #FDFDFD; 
background-color:transparent; 
color:#15428b; 
font-family:SimSun; 
font-size:12px; 
vertical-align:middle; 
text-align:center; 
font-weight:bolder; 
} 
div.gridbox_dhx_skyblue { 
border:1px solid  #A4BED4; 
} 
div.gridbox_dhx_skyblue table.obj tr  td{ 
padding-top:3px; 
padding-bottom:3px; 
} 
* html .gridbox_dhx_skyblue .obj td{ 
height:auto; 
padding-top:3px; 
padding-bottom:3px; 
} 
div.gridbox_dhx_skyblue table.obj.row20px tr  td{ 
padding-top:0px; 
padding-bottom:0px; 
} 
div.gridbox_dhx_skyblue table.obj.row20px tr  td.editable{ 
padding:0px; 
} 
div.gridbox_dhx_skyblue table.obj tr  td.editable div.treegrid_cell{ 
padding-left:4px; 
padding-top:1px; 
} 
div.gridbox_dhx_skyblue table.obj tr.rowselected{ 
background-color:#FFFFBB; 
} 
div.gridbox_dhx_skyblue table.obj tr.rowselected td{ 
background-color:#FFFFBB; 
background-repeat:repeat-x; 
background-position:0px 0px;     
/*background-image:url(../imgs/sky_blue_sel2.png);*/ 
} 
div.gridbox_dhx_skyblue table.obj.row20px tr.rowselected td{ 
background-repeat:repeat-x; 
background-position:0px 0px;     
/*background-image:url(../imgs/sky_blue_sel.png);*/     
} 
div.gridbox_dhx_skyblue table.obj tr.rowselected td.cellselected { 
background-color:#FFFFBB; 
} 
div.gridbox_dhx_skyblue .odd_dhx_skyblue{ 
background-color:#E3EFFF; 
} 
.dhx_combo_select, .gridbox_dhx_skyblue .dhx_combo_edit, .gridbox_dhx_skyblue .dhx_textarea{ 
font-family:Tahoma; 
font-size:12px; 
} 
.gridbox_dhx_skyblue .dhx_combo_edit{ 
padding:1px 0px 1px 1px; 
} 
.gridbox_dhx_skyblue .dhx_sub_row { 
background-color:transparent; 
} 
/* rowselector */ 
div.gridbox table.obj.row20px tr td.rowselector, 
div.gridbox_dhx_skyblue table.obj tr td.rowselector { 
line-height: normal; 
border-right: 1px solid #A4BED4; 
background-color: #E3EFFF; 
vertical-align: top; 
padding: 0px; 
} 
div.gridbox_dhx_skyblue table.obj tr td.rowselector div.rowselector2 { 
line-height: normal; 
position: relative; 
width: 100%; 
height: 100%; 
background-image: url("../imgs/dhxgrid_dhx_skyblue/rowselector.png"); 
background-position: left bottom; 
background-repeat: no-repeat; 
overflow: hidden; 
} 
div.gridbox_dhx_skyblue table.obj tr td.rowselector div.rowselector2 div.rowselector3 { 
position: absolute; 
top: 0px; 
left: 0px; 
width: 100%; 
height: 1px; 
line-height: normal; 
background-image: url("../imgs/dhxgrid_dhx_skyblue/rowselector.png"); 
background-position: left top; 
background-repeat: no-repeat; 
overflow: hidden; 
} 
div.gridbox_dhx_skyblue table.obj tr td.rowselector div.rowselector2 div.rowselector4 { 
position: absolute; 
top: 0px; 
left: 0px; 
width: 100%; 
height: 100%; 
line-height: normal; 
background: none; 
background-position: center center; 
background-repeat: no-repeat; 
overflow: hidden; 
} 
div.gridbox_dhx_skyblue table.obj tr.rowselected td.rowselector div.rowselector2 div.rowselector4 { 
background-image: url("../imgs/dhxgrid_dhx_skyblue/arrow.png"); 
} 
div.gridbox_dhx_skyblue table.obj tr.rowselected td.rowselector.editmode div.rowselector2 div.rowselector4 { 
background-image: url("../imgs/dhxgrid_dhx_skyblue/asteriks.png"); 
} 
/*-------------------------合计-----------------------------------*/ 
div.gridbox div.ftr{ 
left:0px; 
bottom:1px; 
width:100%; 
overflow:hidden; 
} 
div.gridbox div.ftr td { 
padding:0px; 
padding-left:10px; 
padding-right:5px; 
border-top:1px solid #A4BED4; 
border-right:1px solid #A4BED4; 
background-color:#ffffcc; 
font-style : normal; 
font-family:SimSun; 
font-size:12px; 
overflow:hidden; 
} 
div.gridbox table.hdr td.columnTargetR div.hdrcell{ 
border-right:3px double #FF6600; 
border-left:3px solid #D4D0C8; 
} 
div.gridbox table.hdr td.columnTargetL div.hdrcell{ 
border-right:3px solid #D4D0C8; 
border-left:3px double #FF6600; 
}

dhtmlxcommon.js

//v.3.6 build 130619 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/ 
dhtmlx=function(a){for(var b in a)dhtmlx[b]=a[b];return dhtmlx};dhtmlx.extend_api=function(a,b,c){var d=window[a];if(d)window[a]=function(a){if(a&&typeof a=="object"&&!a.tagName){var c=d.apply(this,b._init?b._init(a):arguments),f;for(f in dhtmlx)if(b[f])this[b[f]](dhtmlx[f]);for(f in a)if(b[f])this[b[f]](a[f]);else f.indexOf("on")==0&&this.attachEvent(f,a[f])}else c=d.apply(this,arguments);b._patch&&b._patch(this);return c||this},window[a].prototype=d.prototype,c&&dhtmlXHeir(window[a].prototype,c)}; 
dhtmlxAjax={get:function(a,b){var c=new dtmlXMLLoaderObject(!0);c.async=arguments.length<3;c.waitCall=b;c.loadXML(a);return c},post:function(a,b,c){var d=new dtmlXMLLoaderObject(!0);d.async=arguments.length<4;d.waitCall=c;d.loadXML(a,!0,b);return d},getSync:function(a){return this.get(a,null,!0)},postSync:function(a,b){return this.post(a,b,null,!0)}}; 
function dtmlXMLLoaderObject(a,b,c,d){this.xmlDoc="";this.async=typeof c!="undefined"?c:!0;this.onloadAction=a||null;this.mainObject=b||null;this.waitCall=null;this.rSeed=d||!1;return this}dtmlXMLLoaderObject.count=0; 
dtmlXMLLoaderObject.prototype.waitLoadFunction=function(a){var b=!0;return this.check=function(){if(a&&a.onloadAction!=null&&(!a.xmlDoc.readyState||a.xmlDoc.readyState==4)&&b){b=!1;dtmlXMLLoaderObject.count++;if(typeof a.onloadAction=="function")a.onloadAction(a.mainObject,null,null,null,a);if(a.waitCall)a.waitCall.call(this,a),a.waitCall=null}}}; 
dtmlXMLLoaderObject.prototype.getXMLTopNode=function(a,b){if(this.xmlDoc.responseXML){var c=this.xmlDoc.responseXML.getElementsByTagName(a);c.length==0&&a.indexOf(":")!=-1&&(c=this.xmlDoc.responseXML.getElementsByTagName(a.split(":")[1]));var d=c[0]}else d=this.xmlDoc.documentElement;if(d)return this._retry=!1,d;if(!this._retry&&_isIE)return this._retry=!0,b=this.xmlDoc,this.loadXMLString(this.xmlDoc.responseText.replace(/^[/s]+/,""),!0),this.getXMLTopNode(a,b);dhtmlxError.throwError("LoadXML","Incorrect XML", 
[b||this.xmlDoc,this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(a,b){if(_isIE)this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM"),this.xmlDoc.async=this.async,this.xmlDoc.onreadystatechange=function(){},this.xmlDoc.loadXML(a);else{var c=new DOMParser;this.xmlDoc=c.parseFromString(a,"text/xml")}if(!b){if(this.onloadAction)this.onloadAction(this.mainObject,null,null,null,this);if(this.waitCall)this.waitCall(),this.waitCall=null}}; 
dtmlXMLLoaderObject.prototype.loadXML=function(a,b,c,d){this.rSeed&&(a+=(a.indexOf("?")!=-1?"&":"?")+"a_dhx_rSeed="+(new Date).valueOf());this.filePath=a;this.xmlDoc=!_isIE&&window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(this.async)this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this);this.xmlDoc.open(b?"POST":"GET",a,this.async);d?(this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")"),this.xmlDoc.setRequestHeader("Content-type", 
"text/xml")):b&&this.xmlDoc.setRequestHeader("Content-type",this.contenttype||"application/x-www-form-urlencoded");this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(c);this.async||(new this.waitLoadFunction(this))()}; 
dtmlXMLLoaderObject.prototype.destructor=function(){return this.setXSLParamValue=this.getXMLTopNode=this.xmlNodeToJSON=this.doSerialization=this.loadXMLString=this.loadXML=this.doXSLTransToString=this.doXSLTransToObject=this.doXPathOpera=this.doXPath=this.xmlDoc=this.mainObject=this.onloadAction=this.filePath=this.rSeed=this.async=this._retry=this._getAllNamedChilds=this._filterXPath=null}; 
dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(a){for(var b={},c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;b._tagvalue=a.firstChild?a.firstChild.nodeValue:"";for(c=0;c<a.childNodes.length;c++){var d=a.childNodes[c].tagName;d&&(b[d]||(b[d]=[]),b[d].push(this.xmlNodeToJSON(a.childNodes[c])))}return b};function callerFunction(a,b){return this.handler=function(c){if(!c)c=window.event;a(c,b);return!0}}function getAbsoluteLeft(a){return getOffset(a).left} 
function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}} 
function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,g=window.pageXOffset||d.scrollLeft||c.scrollLeft,f=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-f,k=b.left+g-h;return{top:Math.round(i),left:Math.round(k)}}function getOffset(a){return a.getBoundingClientRect?getOffsetRect(a):getOffsetSum(a)} 
function convertStringToBoolean(a){typeof a=="string"&&(a=a.toLowerCase());switch(a){case "1":case "true":case "yes":case "y":case 1:case !0:return!0;default:return!1}}function getUrlSymbol(a){return a.indexOf("?")!=-1?"&":"?"}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop)return window.dhtmlDragAndDrop;this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0;this.tempDOMM=this.tempDOMU=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this} 
dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b}; 
dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if(!((a||window.event)&&(a||event).button==2)){if(window.dhtmlDragAndDrop.waitDrag)return window.dhtmlDragAndDrop.waitDrag=0,document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU,document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM,!1;window.dhtmlDragAndDrop.dragNode&&window.dhtmlDragAndDrop.stopDrag(a);window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM= 
document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=(new Date).valueOf();a&&a.preventDefault&&a.preventDefault();return!1}}; 
dhtmlDragAndDropObject.prototype.callDrag=function(a){if(!a)a=window.event;dragger=window.dhtmlDragAndDrop;if(!((new Date).valueOf()-dragger.downtime<100)){if(!dragger.dragNode)if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,a);if(!dragger.dragNode)return dragger.stopDrag();dragger.dragNode.onselectstart=function(){return!1};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag= 
0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else return dragger.stopDrag(a,!0);if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var b=dragger.gldragNode;if(dragger.gldragNode.old)b=dragger.gldragNode.old;b.parentNode.removeChild(b);var c=dragger.dragNode.pWindow;b.pWindow&&b.pWindow.dhtmlDragAndDrop.lastLanding&&b.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(b.pWindow.dhtmlDragAndDrop.lastLanding);if(_isIE){var d=document.createElement("Div");d.innerHTML= 
dragger.dragNode.outerHTML;dragger.dragNode=d.childNodes[0]}else dragger.dragNode=dragger.dragNode.cloneNode(!0);dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=a.clientX+15+(dragger.fx?dragger.fx*-1:0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=a.clientY+3+(dragger.fy?dragger.fy*-1:0)+(document.body.scrollTop|| 
document.documentElement.scrollTop)+"px";var e=a.srcElement?a.srcElement:a.target;dragger.checkLanding(e,a)}};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(a){if(window.name){for(var b=parent.frames[window.name].frameElement.offsetParent,c=0,d=0;b;)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;if(parent.dhtmlDragAndDrop){var e=parent.dhtmlDragAndDrop.calculateFramePosition(1);c+=e.split("_")[0]*1;d+=e.split("_")[1]*1}if(a)return c+"_"+d;else this.fx=c;this.fy=d}return"0_0"}; 
dhtmlDragAndDropObject.prototype.checkLanding=function(a,b){a&&a.dragLanding?(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding),this.lastLanding=a,this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,b.clientX,b.clientY,b),this.lastLanding_scr=_isIE?b.srcElement:b.target):a&&a.tagName!="BODY"?this.checkLanding(a.parentNode,b):(this.lastLanding&&this.lastLanding.dragLanding._dragOut(this.lastLanding,b.clientX,b.clientY,b),this.lastLanding= 
0,this._onNotFound&&this._onNotFound())}; 
dhtmlDragAndDropObject.prototype.stopDrag=function(a,b){dragger=window.dhtmlDragAndDrop;if(!b){dragger.stopFrameRoute();var c=dragger.lastLanding;dragger.lastLanding=null;c&&c.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,c,_isIE?event.srcElement:a.target)}dragger.lastLanding=null;dragger.dragNode&&dragger.dragNode.parentNode==document.body&&dragger.dragNode.parentNode.removeChild(dragger.dragNode);dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode= 
0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(a){a&&window.dhtmlDragAndDrop.stopDrag(1,1);for(var b=0;b<window.frames.length;b++)try{window.frames[b]!=a&&window.frames[b].dhtmlDragAndDrop&&window.frames[b].dhtmlDragAndDrop.stopFrameRoute(window)}catch(c){}try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.stopFrameRoute(window)}catch(d){}}; 
dhtmlDragAndDropObject.prototype.initFrameRoute=function(a,b){if(a)window.dhtmlDragAndDrop.preCreateDragCopy(),window.dhtmlDragAndDrop.dragStartNode=a.dhtmlDragAndDrop.dragStartNode,window.dhtmlDragAndDrop.dragStartObject=a.dhtmlDragAndDrop.dragStartObject,window.dhtmlDragAndDrop.dragNode=a.dhtmlDragAndDrop.dragNode,window.dhtmlDragAndDrop.gldragNode=a.dhtmlDragAndDrop.dragNode,window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag,window.waitDrag=0,!_isIE&&b&&(!_isFF||_FFrv<1.8)&&window.dhtmlDragAndDrop.calculateFramePosition(); 
try{parent.dhtmlDragAndDrop&&parent!=window&&parent!=a&&parent.dhtmlDragAndDrop.initFrameRoute(window)}catch(c){}for(var d=0;d<window.frames.length;d++)try{window.frames[d]!=a&&window.frames[d].dhtmlDragAndDrop&&window.frames[d].dhtmlDragAndDrop.initFrameRoute(window,!a||b?1:0)}catch(e){}};_OperaRv=_KHTMLrv=_FFrv=_isChrome=_isMacOS=_isKHTML=_isOpera=_isIE=_isFF=!1;navigator.userAgent.indexOf("Macintosh")!=-1&&(_isMacOS=!0);navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(_isChrome=!0); 
if(navigator.userAgent.indexOf("Safari")!=-1||navigator.userAgent.indexOf("Konqueror")!=-1)_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5)),_KHTMLrv>525?(_isFF=!0,_FFrv=1.9):_isKHTML=!0;else if(navigator.userAgent.indexOf("Opera")!=-1)_isOpera=!0,_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3));else if(navigator.appName.indexOf("Microsoft")!=-1){if(_isIE=!0,(navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!= 
-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1||document.documentMode>7)&&document.compatMode!="BackCompat")_isIE=8}else _isFF=!0,_FFrv=parseFloat(navigator.userAgent.split("rv:")[1]); 
dtmlXMLLoaderObject.prototype.doXPath=function(a,b,c,d){if(_isKHTML||!_isIE&&!window.XPathResult)return this.doXPathOpera(a,b);if(_isIE)return b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML),b||dhtmlxError.throwError("LoadXML","Incorrect XML",[b||this.xmlDoc,this.mainObject]),c!=null&&b.setProperty("SelectionNamespaces","xmlns:xsl='"+c+"'"),d=="single"?b.selectSingleNode(a):b.selectNodes(a)||[];else{var e=b;b||(b=this.xmlDoc.nodeName?this.xmlDoc:this.xmlDoc.responseXML);b||dhtmlxError.throwError("LoadXML", 
"Incorrect XML",[b||this.xmlDoc,this.mainObject]);b.nodeName.indexOf("document")!=-1?e=b:(e=b,b=b.ownerDocument);var g=XPathResult.ANY_TYPE;if(d=="single")g=XPathResult.FIRST_ORDERED_NODE_TYPE;var f=[],h=b.evaluate(a,e,function(){return c},g,null);if(g==XPathResult.FIRST_ORDERED_NODE_TYPE)return h.singleNodeValue;for(var i=h.iterateNext();i;)f[f.length]=i,i=h.iterateNext();return f}};function j(){if(!this.catches)this.catches=[];return this}j.prototype.catchError=function(a,b){this.catches[a]=b}; 
j.prototype.throwError=function(a,b,c){if(this.catches[a])return this.catches[a](a,b,c);if(this.catches.ALL)return this.catches.ALL(a,b,c);alert("Error type: "+a+"/nDescription: "+b);return null};window.dhtmlxError=new j; 
dtmlXMLLoaderObject.prototype.doXPathOpera=function(a,b){var c=a.replace(/[//]+/gi,"/").split("/"),d=null,e=1;if(!c.length)return[];if(c[0]==".")d=[b];else if(c[0]=="")d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(c[e].replace(//[[^/]]*/]/g,"")),e++;else return[];for(;e<c.length;e++)d=this._getAllNamedChilds(d,c[e]);c[e-1].indexOf("[")!=-1&&(d=this._filterXPath(d,c[e-1]));return d}; 
dtmlXMLLoaderObject.prototype._filterXPath=function(a,b){for(var c=[],b=b.replace(/[^/[]*/[/@/g,"").replace(/[/[/]/@]*/g,""),d=0;d<a.length;d++)a[d].getAttribute(b)&&(c[c.length]=a[d]);return c}; 
dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(a,b){var c=[];_isKHTML&&(b=b.toUpperCase());for(var d=0;d<a.length;d++)for(var e=0;e<a[d].childNodes.length;e++)_isKHTML?a[d].childNodes[e].tagName&&a[d].childNodes[e].tagName.toUpperCase()==b&&(c[c.length]=a[d].childNodes[e]):a[d].childNodes[e].tagName==b&&(c[c.length]=a[d].childNodes[e]);return c};function dhtmlXHeir(a,b){for(var c in b)typeof b[c]=="function"&&(a[c]=b[c]);return a} 
function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(a,b,c){if(!c)c=this.xslDoc;if(c.responseXML)c=c.responseXML;var d=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+a+"']",c,"http://www.w3.org/1999/XSL/Transform","single");if(d!=null)d.firstChild.nodeValue=b}; 
dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(a,b){if(!a)a=this.xslDoc;if(a.responseXML)a=a.responseXML;if(!b)b=this.xmlDoc;if(b.responseXML)b=b.responseXML;if(_isIE){d=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(a,d)}catch(c){d=b.transformNode(a)}}else{if(!this.XSLProcessor)this.XSLProcessor=new XSLTProcessor,this.XSLProcessor.importStylesheet(a);var d=this.XSLProcessor.transformToDocument(b)}return d}; 
dtmlXMLLoaderObject.prototype.doXSLTransToString=function(a,b){var c=this.doXSLTransToObject(a,b);return typeof c=="string"?c:this.doSerialization(c)};dtmlXMLLoaderObject.prototype.doSerialization=function(a){if(!a)a=this.xmlDoc;if(a.responseXML)a=a.responseXML;if(_isIE)return a.xml;else{var b=new XMLSerializer;return b.serializeToString(a)}}; 
dhtmlxEventable=function(a){a.attachEvent=function(a,c,d){a="ev_"+a.toLowerCase();this[a]||(this[a]=new this.eventCatcher(d||this));return a+":"+this[a].addEvent(c)};a.callEvent=function(a,c){a="ev_"+a.toLowerCase();return this[a]?this[a].apply(this,c):!0};a.checkEvent=function(a){return!!this["ev_"+a.toLowerCase()]};a.eventCatcher=function(a){var c=[],d=function(){for(var d=!0,g=0;g<c.length;g++)if(c[g]!=null)var f=c[g].apply(a,arguments),d=d&&f;return d};d.addEvent=function(a){typeof a!="function"&& 
(a=eval(a));return a?c.push(a)-1:!1};d.removeEvent=function(a){c[a]=null};return d};a.detachEvent=function(a){if(a!=!1){var c=a.split(":");this[c[0]].removeEvent(c[1])}};a.detachAllEvents=function(){for(var a in this)a.indexOf("ev_")==0&&(this.detachEvent(a),this[a]=null)};a=null}; 
//v.3.6 build 130619 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/

dhtmlxgrid.js

//v.3.6 build 130619 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/ 
var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/&nbsp;/g," ").replace(/(^[ /t]*)|([ /t]*$)/g,"")};function dhtmlxArray(a){return dhtmlXHeir(a||[],dhtmlxArray._master)} 
dhtmlxArray._master={_dhx_find:function(a){for(var b=0;b<this.length;b++)if(a==this[b])return b;return-1},_dhx_insertAt:function(a,b){this[this.length]=null;for(var c=this.length-1;c>=a;c--)this[c]=this[c-1];this[a]=b},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,b){var c=this[a];this[a]=this[b];this[b]=c}}; 
function dhtmlXGridObject(a){if(_isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(b){}if(a)if(typeof a=="object"){if(this.entBox=a,!this.entBox.id)this.entBox.id="cgrid2_"+this.uid()}else this.entBox=document.getElementById(a);else this.entBox=document.createElement("DIV"),this.entBox.id="cgrid2_"+this.uid();this.entBox.innerHTML="";dhtmlxEventable(this);var c=this;this._wcorr=0;this.fontWidth=7;this.row=this.cell=null;this.iconURL="";this.editor=null;this._dclE=this._f2kE=!0;this.combos= 
[];this.defVal=[];this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=!0;this.xmlLoader=new dtmlXMLLoaderObject(this.doLoadDetails,this,!0,this.no_cashe);this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this._sizeFix=this._borderFix=0;this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?this.entBox.style.width||window.getComputedStyle(this.entBox, 
null).width:this.entBox.currentStyle?this.entBox.currentStyle.width:this.entBox.style.width||0)||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?this.entBox.style.height||window.getComputedStyle(this.entBox,null).height:this.entBox.currentStyle?this.entBox.currentStyle.height:this.entBox.style.height||0)||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return!1};var d=function(e){var a=document.createElement("TABLE");a.cellSpacing= 
a.cellPadding=0;a.style.cssText="width:100%;table-layout:fixed;";a.className=e.substr(2);return a};this.obj=d("c_obj");this.hdr=d("c_hdr");this.hdr.style.marginRight="20px";this.hdr.style.paddingRight="20px";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.overflow="auto";this.objBox.appendChild(this.obj);this.objBox.className="objbox";dhtmlx.$customScroll&&dhtmlx.CustomScroll.enable(this);this.hdrBox=document.createElement("DIV");this.hdrBox.style.width= 
"100%";this.hdrBox.style.height="25px";this.hdrBox.style.overflow="hidden";this.hdrBox.className="xhdr";this.preloadImagesAr=[];this.sortImg=document.createElement("IMG");this.sortImg.style.display="none";this.hdrBox.appendChild(this.sortImg);this.hdrBox.appendChild(this.hdr);this.hdrBox.style.position="relative";this.entBox.appendChild(this.hdrBox);this.entBox.appendChild(this.objBox);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX= 
[];this.cellWidthPC=[];this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this._hrrar=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this._srdh=_isIE&&document.compatMode!="BackCompat"?22:20;this.imgURL=window.dhx_globalImgPath||"";this.isActive=!1;this.isEditable=!0;this.pagingOn=this.useImagesInHeader=!1;this.rowsBufferOutSize=0;dhtmlxEvent(window, 
"unload",function(){try{c.destructor&&c.destructor()}catch(e){}});this.setSkin=function(e){this.skin_name=e;var a=this.entBox.className.split(" gridbox")[0];this.entBox.className=a+" gridbox gridbox_"+e;this.skin_h_correction=0;this.enableAlterCss("ev_"+e,"odd_"+e,this.isTreeGrid());this._fixAlterCss();switch(e){case "clear":this._topMb=document.createElement("DIV");this._topMb.className="topMumba";this._topMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinC_top_left.gif'><img style='right:20px' src='"+ 
this.imgURL+"skinC_top_right.gif'>";this.entBox.appendChild(this._topMb);this._botMb=document.createElement("DIV");this._botMb.className="bottomMumba";this._botMb.innerHTML="<img style='left:0px'   src='"+this.imgURL+"skinD_bottom_left.gif'><img style='right:20px' src='"+this.imgURL+"skinD_bottom_right.gif'>";this.entBox.appendChild(this._botMb);if(this.entBox.style.position!="absolute")this.entBox.style.position="relative";this.skin_h_correction=20;break;case "dhx_terrace":this._srdh=40;this.forceDivInHeader= 
!0;break;case "dhx_skyblue":case "dhx_web":case "glassy_blue":case "dhx_black":case "dhx_blue":case "modern":case "light":this._srdh=20;this.forceDivInHeader=!0;break;case "xp":this.forceDivInHeader=!0;this._srdh=_isIE&&document.compatMode!="BackCompat"?26:22;break;case "mt":this._srdh=_isIE&&document.compatMode!="BackCompat"?26:22;break;case "gray":if(_isIE&&document.compatMode!="BackCompat")this._srdh=22}if(_isIE&&this.hdr){var b=this.hdr.parentNode;b.removeChild(this.hdr);b.appendChild(this.hdr)}this.setSizes()}; 
_isIE&&this.preventIECaching(!0);if(window.dhtmlDragAndDropObject)this.dragger=new dhtmlDragAndDropObject;this._doOnScroll=function(e,a){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,a)};this.doOnScroll=function(e,a){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr)this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft;if(!a&&this._srnd)this._dLoadTimer&&window.clearTimeout(this._dLoadTimer),this._dLoadTimer=window.setTimeout(function(){c._update_srnd_view&& 
c._update_srnd_view()},100)};this.attachToObject=function(e){e.appendChild(this.globalBox?this.globalBox:this.entBox);this.setSizes()};this.init=function(e){if(this.isTreeGrid()&&!this._h2){this._h2=new dhtmlxHierarchy;if(this._fake&&!this._realfake)this._fake._h2=this._h2;this._tgc={imgURL:null}}if(this._hstyles){this.editStop();this.fldSorted=this.r_fldSorted=this.resized=this.lastClicked=null;this.cellWidthPX=[];this.cellWidthPC=[];if(this.hdr.rows.length>0){var a=this.xmlFileUrl;this.clearAll(!0); 
this.xmlFileUrl=a}for(var b=this.hdr.insertRow(0),f=0;f<this.hdrLabels.length;f++)b.appendChild(document.createElement("TH")),b.childNodes[f]._cellIndex=f,b.childNodes[f].style.height="0px";_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined?b.style.position="absolute":b.style.height="auto";b=this.hdr.insertRow(_isKHTML?2:1);b._childIndexes=[];for(var d=0,f=0;f<this.hdrLabels.length;f++)b._childIndexes[f]=f-d,this.hdrLabels[f]==this.splitSign&&f!=0?(_isKHTML&&b.insertCell(f-d),b.cells[f- 
d-1].colSpan=(b.cells[f-d-1].colSpan||1)+1,b.childNodes[f-d-1]._cellIndex++,d++,b._childIndexes[f]=f-d):(b.insertCell(f-d),b.childNodes[f-d]._cellIndex=f,b.childNodes[f-d]._cellIndexS=f,this.setColumnLabel(f,this.hdrLabels[f]));if(d==0)b._childIndexes=null;this._cCount=this.hdrLabels.length;_isIE&&window.setTimeout(function(){c.setSizes&&c.setSizes()},1);this.obj.firstChild||this.obj.appendChild(document.createElement("TBODY"));var h=this.obj.firstChild;if(!h.firstChild){h.appendChild(document.createElement("TR")); 
h=h.firstChild;_isIE&&_isIE<8&&document.body.style.msTouchAction==this.undefined?h.style.position="absolute":h.style.height="auto";for(f=0;f<this.hdrLabels.length;f++)h.appendChild(document.createElement("TH")),h.childNodes[f].style.height="0px"}this._c_order=null;this.multiLine!=!0&&(this.obj.className+=" row20px");this.sortImg.style.position="absolute";this.sortImg.style.display="none";this.sortImg.src=this.imgURL+"sort_desc.gif";this.sortImg.defLeft=0;this.noHeader?this.hdrBox.style.display="none": 
this.noHeader=!1;this._ivizcol&&this.setColHidden();this.attachHeader();this.attachHeader(0,0,"_aFoot");this.setSizes();e&&this.parseXML();this.obj.scrollTop=0;this.dragAndDropOff&&this.dragger.addDragLanding(this.entBox,this);this._initDrF&&this._initD();this._init_point&&this._init_point()}};this.setColumnSizes=function(e){for(var a=0,b=[],c=0,d=0;d<this._cCount;d++)if(this.initCellWidth[d]=="*"&&!this._hrrar[d])this._awdth=!1,b.push(d);else{if(this.cellWidthType=="%"){typeof this.cellWidthPC[d]== 
"undefined"&&(this.cellWidthPC[d]=this.initCellWidth[d]);var h=e*this.cellWidthPC[d]/100||0;c>0.5&&(h++,c--);var l=this.cellWidthPX[d]=Math.floor(h),c=c+h-l}else typeof this.cellWidthPX[d]=="undefined"&&(this.cellWidthPX[d]=this.initCellWidth[d]);this._hrrar[d]||(a+=this.cellWidthPX[d]*1)}if(b.length){var k=Math.floor((e-a)/b.length);k<0&&(k=1);for(d=0;d<b.length;d++){var m=Math.max(this._drsclmW?this._drsclmW[b[d]]||0:0,k);this.cellWidthPX[b[d]]=m;a+=m}if(e>a){var n=b[b.length-1];this.cellWidthPX[n]+= 
e-a;a=e}this._setAutoResize()}this.obj.style.width=a+"px";this.hdr.style.width=a+"px";if(this.ftr)this.ftr.style.width=a+"px";this.chngCellWidth();return a};this.setSizes=function(){if(this.hdr.rows[0]){var e=this.quirks=_isIE&&document.compatMode=="BackCompat",a=(this.entBox.offsetWidth-this.entBox.clientWidth)/2;if(!this.dontSetSizes)if(this.globalBox){var b=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;if(this._delta_x&&!this._realfake){var f=this.globalBox.clientWidth;this.globalBox.style.width= 
this._delta_x;this.entBox.style.width=Math.max(0,this.globalBox.clientWidth+(e?b*2:0)-this._fake.entBox.clientWidth)+"px";f!=this.globalBox.clientWidth&&this._fake._correctSplit(this._fake.entBox.clientWidth)}if(this._delta_y&&!this._realfake)this.globalBox.style.height=this._delta_y,this.entBox.style.overflow=this._fake.entBox.style.overflow="hidden",this.entBox.style.height=this._fake.entBox.style.height=this.globalBox.clientHeight+(e?b*2:0)+"px"}else{if(this._delta_x)this.entBox.parentNode&&this.entBox.parentNode.tagName== 
"TD"?(this.entBox.style.width="1px",this.entBox.style.width=parseInt(this._delta_x)*this.entBox.parentNode.clientWidth/100-a*2+"px"):this.entBox.style.width=this._delta_x;if(this._delta_y)this.entBox.style.height=this._delta_y}window.clearTimeout(this._sizeTime);if(!this.entBox.offsetWidth&&(!this.globalBox||!this.globalBox.offsetWidth))this._sizeTime=window.setTimeout(function(){c.setSizes&&c.setSizes()},250);else{var d=!this._wthB&&(this.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")== 
0&&!e?2:0,h=!this._wthB&&(this.entBox.cmp||this._delta_y)&&(this.skin_name||"").indexOf("dhx")==0&&!e?2:0;this._sizeFix&&(d-=this._sizeFix,h-=this._sizeFix);var l=this.parentGrid?!1:this.objBox.scrollHeight>this.objBox.offsetHeight,k=dhtmlx.$customScroll?0:18,m=this.entBox.clientWidth-(this.skin_h_correction||0)*(e?0:1)-d,n=this.entBox.clientWidth-(this.skin_h_correction||0)-d,o=this.entBox.clientHeight-h,p=this.setColumnSizes(n-(l?k:0)-(this._correction_x||0)),r=this.parentGrid?!1:this.objBox.scrollWidth> 
this.objBox.offsetWidth||this.objBox.style.overflowX=="scroll",q=this.hdr.clientHeight,s=this.ftr?this.ftr.clientHeight:0,u=m,t=o-q-s;this._awdth&&this._awdth[0]&&this._awdth[1]==99999&&(r=0);if(this._ahgr&&(t=this._ahgrMA?this.entBox.parentNode.clientHeight-q-s:this.obj.offsetHeight+(r?k:0)+(this._correction_y||0),this._ahgrM&&(t=this._ahgrF?Math.min(this._ahgrM,t+q+s)-q-s:Math.min(this._ahgrM,t)),l&&t>=this.obj.scrollHeight+(r?k:0)))l=!1,this.setColumnSizes(n-(this._correction_x||0));if(this._awdth&& 
this._awdth[0]){if(this.cellWidthType=="%")this.cellWidthType="px";this._fake&&(p+=this._fake.entBox.clientWidth);u=Math.min(Math.max(p+(l?k:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this._fake&&(u-=this._fake.entBox.clientWidth)}t=Math.max(0,t);this._ff_size_delta=this._ff_size_delta==0.1?0.2:0.1;if(!_isFF)this._ff_size_delta=0;if(!this.dontSetSizes)this.entBox.style.width=Math.max(0,u+(e?2:0)*a+this._ff_size_delta)+"px",this.entBox.style.height=t+(e?2:0)*a+q+s+"px";this.objBox.style.height= 
t+(e&&!l?2:0)*a+"px";this.hdrBox.style.height=q+"px";t!=o&&this.doOnScroll(0,!this._srnd);var v=this["setSizes_"+this.skin_name];v&&v.call(this);this.setSortImgPos();q!=this.hdr.clientHeight&&this._ahgr&&this.setSizes();this.callEvent("onSetSizes",[])}}};this.setSizes_clear=function(){var e=this.hdr.offsetHeight,a=this.entBox.offsetWidth,b=e+this.objBox.offsetHeight;this._topMb.style.top=(e||0)+"px";this._topMb.style.width=a+20+"px";this._botMb.style.top=b-3+"px";this._botMb.style.width=a+20+"px"}; 
this.chngCellWidth=function(){if(_isOpera&&this.ftr)this.ftr.width=this.objBox.scrollWidth+"px";for(var e=this._cCount,a=0;a<e;a++)if(this.hdr.rows[0].cells[a].style.width=this.cellWidthPX[a]+"px",this.obj.rows[0].childNodes[a].style.width=this.cellWidthPX[a]+"px",this.ftr)this.ftr.rows[0].cells[a].style.width=this.cellWidthPX[a]+"px"};this.setDelimiter=function(e){this.delim=e};this.setInitWidthsP=function(e,a){this.cellWidthType="%";this.initCellWidth=e.split(this.delim.replace(/px/gi,""));a||this._setAutoResize()}; 
this._setAutoResize=function(){if(!this._realfake){var e=window,a=this;dhtmlxEvent(window,"resize",function(){window.clearTimeout(a._resize_timer);if(a._setAutoResize)a._resize_timer=window.setTimeout(function(){a.setSizes&&a.setSizes();a._fake&&a._fake._correctSplit()},100)})}};this.setInitWidths=function(a){this.cellWidthType="px";this.initCellWidth=a.split(this.delim);if(_isFF)for(var b=0;b<this.initCellWidth.length;b++)this.initCellWidth[b]!="*"&&(this.initCellWidth[b]=parseInt(this.initCellWidth[b]))}; 
this.enableMultiline=function(a){this.multiLine=convertStringToBoolean(a)};this.enableMultiselect=function(a){this.selMultiRows=convertStringToBoolean(a)};this.setImagesPath=this.setImagePath=function(a){this.imgURL=a};this.setIconsPath=this.setIconPath=function(a){this.iconURL=a};this.changeCursorState=function(a){var b=a.target||a.srcElement;b.tagName!="TD"&&(b=this.getFirstParentOfType(b,"TD"));if(b){if(b.tagName=="TD"&&this._drsclmn&&!this._drsclmn[b._cellIndex])return b.style.cursor="default"; 
var c=(a.layerX||0)+(!_isIE&&a.target.tagName=="DIV"?b.offsetLeft:0);b.style.cursor=b.offsetWidth-(a.offsetX||(parseInt(this.getPosition(b,this.hdrBox))-c)*-1)<(_isOpera?20:10)?"E-resize":"default";if(_isOpera)this.hdrBox.scrollLeft=this.objBox.scrollLeft}};this.startColResize=function(a){this.resized&&this.stopColResize();this.resized=null;var b=a.target||a.srcElement;b.tagName!="TD"&&(b=this.getFirstParentOfType(b,"TD"));var i=a.clientX,f=this.hdr.offsetWidth,d=parseInt(b.offsetWidth);if(b.tagName== 
"TD"&&b.style.cursor!="default"&&(!this._drsclmn||this._drsclmn[b._cellIndex]))c._old_d_mm=document.body.onmousemove,c._old_d_mu=document.body.onmouseup,document.body.onmousemove=function(a){c&&c.doColResize(a||window.event,b,d,i,f)},document.body.onmouseup=function(){c&&c.stopColResize()}};this.stopColResize=function(){document.body.onmousemove=c._old_d_mm||"";document.body.onmouseup=c._old_d_mu||"";this.setSizes();this.doOnScroll(0,1);this.callEvent("onResizeEnd",[this])};this.doColResize=function(a, 
b,c,f,d){b.style.cursor="E-resize";this.resized=b;var h=c+(a.clientX-f),l=d+(a.clientX-f);if(this.callEvent("onResize",[b._cellIndex,h,this])){if(_isIE)this.objBox.scrollLeft=this.hdrBox.scrollLeft;if(b.colSpan>1){for(var k=[],m=0;m<b.colSpan;m++)k[m]=Math.round(h*this.hdr.rows[0].childNodes[b._cellIndexS+m].offsetWidth/b.offsetWidth);for(m=0;m<b.colSpan;m++)this._setColumnSizeR(b._cellIndexS+m*1,k[m])}else this._setColumnSizeR(b._cellIndex,h);this.doOnScroll(0,1);this.setSizes();this._fake&&this._awdth&& 
this._fake._correctSplit()}};this._setColumnSizeR=function(a,b){if(b>(this._drsclmW&&!this._notresize?this._drsclmW[a]||10:10)){this.obj.rows[0].childNodes[a].style.width=b+"px";this.hdr.rows[0].childNodes[a].style.width=b+"px";if(this.ftr)this.ftr.rows[0].childNodes[a].style.width=b+"px";if(this.cellWidthType=="px")this.cellWidthPX[a]=b;else{var c=parseInt(this.entBox.offsetWidth);this.objBox.scrollHeight>this.objBox.offsetHeight&&(c-=17);var f=Math.round(b/c*100);this.cellWidthPC[a]=f}this.sortImg.style.display!= 
"none"&&this.setSortImgPos()}};this.setSortImgState=function(a,b,c,f){c=(c||"asc").toLowerCase();if(convertStringToBoolean(a)){this.sortImg.src=c=="asc"?this.imgURL+"sort_asc.gif":this.imgURL+"sort_desc.gif";this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[b];var d=this.hdr.rows[f||1];if(d){for(var h=0;h<d.childNodes.length;h++)if(d.childNodes[h]._cellIndexS==b)return this.r_fldSorted=d.childNodes[h],this.setSortImgPos();return this.setSortImgState(a,b,c,(f||1)+1)}}else this.sortImg.style.display= 
"none",this.fldSorted=this.r_fldSorted=null};this.setSortImgPos=function(a,b,c,f){if(!this._hrrar||!this._hrrar[this.r_fldSorted?this.r_fldSorted._cellIndex:a])if(f||(f=a?this.hdr.rows[c||0].cells[a]:this.r_fldSorted),f!=null){var d=this.getPosition(f,this.hdrBox),h=f.offsetWidth;this.sortImg.style.left=Number(d[0]+h-13)+"px";this.sortImg.defLeft=parseInt(this.sortImg.style.left);this.sortImg.style.top=Number(d[1]+5)+"px";if(!this.useImagesInHeader&&!b)this.sortImg.style.display="inline";this.sortImg.style.left= 
this.sortImg.defLeft+"px"}};this.setActive=function(a){arguments.length==0&&(a=!0);a==!0?(globalActiveDHTMLGridObject&&globalActiveDHTMLGridObject!=this&&(globalActiveDHTMLGridObject.editStop(),globalActiveDHTMLGridObject.callEvent("onBlur",[globalActiveDHTMLGridObject])),globalActiveDHTMLGridObject=this,this.isActive=!0):(this.isActive=!1,this.callEvent("onBlur",[this]))};this._doClick=function(a){var b=0,c=this.getFirstParentOfType(_isIE?a.srcElement:a.target,"TD");if(c){var f=!0;if(this.markedCells){var d= 
0;if(a.shiftKey||a.metaKey)d=1;a.ctrlKey&&(d=2);this.doMark(c,d);return!0}if(this.selMultiRows!=!1&&(a.shiftKey&&this.row!=null&&this.selectedRows.length&&(b=1),a.ctrlKey||a.metaKey))b=2;this.doClick(c,f,b)}};this._doContClick=function(a){var b=this.getFirstParentOfType(_isIE?a.srcElement:a.target,"TD");if(!b||typeof b.parentNode.idd=="undefined")return this.callEvent("onEmptyClick",[a]),!0;if(a.button==2||_isMacOS&&a.ctrlKey){if(!this.callEvent("onRightClick",[b.parentNode.idd,b._cellIndex,a])){var c= 
function(a){(a||event).cancelBubble=!0;return!1};(a.srcElement||a.target).oncontextmenu=c;return c(a)}if(this._ctmndx){if(!this.callEvent("onBeforeContextMenu",[b.parentNode.idd,b._cellIndex,this]))return!0;if(_isIE)a.srcElement.oncontextmenu=function(){event.cancelBubble=!0;return!1};if(this._ctmndx.showContextMenu){var f=window.document.documentElement,d=window.document.body,h=[f.scrollLeft||d.scrollLeft,f.scrollTop||d.scrollTop];if(_isIE)var l=a.clientX+h[0],k=a.clientY+h[1];else l=a.pageX,k=a.pageY; 
this._ctmndx.showContextMenu(l-1,k-1);this.contextID=this._ctmndx.contextMenuZoneId=b.parentNode.idd+"_"+b._cellIndex;this._ctmndx._skip_hide=!0}else b.contextMenuId=b.parentNode.idd+"_"+b._cellIndex,b.contextMenu=this._ctmndx,b.a=this._ctmndx._contextStart,b.a(b,a),b.a=null;a.cancelBubble=!0;return!1}}else this._ctmndx&&(this._ctmndx.hideContextMenu?this._ctmndx.hideContextMenu():this._ctmndx._contextEnd());return!0};this.doClick=function(a,b,d,f){this.selMultiRows||(d=0);var g=this.row?this.row.idd: 
0;this.setActive(!0);d||(d=0);if(this.cell!=null)this.cell.className=this.cell.className.replace(/cellselected/g,"");if(a.tagName=="TD"){if(this.checkEvent("onSelectStateChanged"))var h=this.getSelectedId();var l=this.row;if(d==1){var k=this.rowsCol._dhx_find(a.parentNode),m=this.rowsCol._dhx_find(this.lastClicked);if(k>m)var n=m,o=k;else n=k,o=m;for(var p=0;p<this.rowsCol.length;p++)if(p>=n&&p<=o)if(this.rowsCol[p]&&!this.rowsCol[p]._sRow)this.rowsCol[p].className.indexOf("rowselected")==-1&&this.callEvent("onBeforeSelect", 
[this.rowsCol[p].idd,g])&&(this.rowsCol[p].className+=" rowselected",this.selectedRows[this.selectedRows.length]=this.rowsCol[p]);else return this.clearSelection(),this.doClick(a,b,0,f)}else if(d==2&&a.parentNode.className.indexOf("rowselected")!=-1){a.parentNode.className=a.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(a.parentNode));var r=!0,f=!1}this.editStop();if(typeof a.parentNode.idd=="undefined")return!0;if(!r&&!a.parentNode._sRow)if(this.callEvent("onBeforeSelect", 
[a.parentNode.idd,g]))if(this.getSelectedRowId()!=a.parentNode.idd){if(d==0&&this.clearSelection(),this.cell=a,l==a.parentNode&&this._chRRS&&(b=!1),this.row=a.parentNode,this.row.className+=" rowselected",this.selectedRows._dhx_find(this.row)==-1)this.selectedRows[this.selectedRows.length]=this.row}else this.cell=a,this.row=a.parentNode;else b=!1;if(this.cell&&this.cell.parentNode.className.indexOf("rowselected")!=-1)this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected"; 
if(d!=1&&!this.row)return;this.lastClicked=a.parentNode;var q=this.row.idd,s=this.cell;b&&typeof q!="undefined"&&s&&!r?c.onRowSelectTime=setTimeout(function(){c.callEvent&&c.callEvent("onRowSelect",[q,s._cellIndex])},100):this.callEvent("onRowSelectRSOnly",[q]);if(this.checkEvent("onSelectStateChanged")){var u=this.getSelectedId();h!=u&&this.callEvent("onSelectStateChanged",[u,h])}}this.isActive=!0;f!==!1&&this.cell&&this.cell.parentNode.idd&&this.moveToVisible(this.cell)};this.selectAll=function(){this.clearSelection(); 
var a=this.rowsBuffer;if(this.pagingOn)a=this.rowsCol;for(var b=0;b<a.length;b++)this.render_row(b).className+=" rowselected";this.selectedRows=dhtmlxArray([].concat(a));if(this.selectedRows.length)this.row=this.selectedRows[0],this.cell=this.row.cells[0];this._fake&&!this._realfake&&this._fake.selectAll()};this.selectCell=function(a,b,c,d,g,h){c||(c=!1);typeof a!="object"&&(a=this.render_row(a));if(!a||a==-1)return null;var l=a._childIndexes?a.childNodes[a._childIndexes[b]]:a.childNodes[b];l||(l= 
a.childNodes[0]);this.markedCells?this.doMark(l,d?2:0):d?this.doClick(l,c,3,h):this.doClick(l,c,0,h);g&&this.editCell()};this.moveToVisible=function(a,b){if(this.pagingOn){var c=Math.floor(this.getRowIndex(a.parentNode.idd)/this.rowsBufferOutSize)+1;c!=this.currentPage&&this.changePage(c)}try{if(a.offsetHeight){var d=a.offsetLeft+a.offsetWidth+20,g=0;d>this.objBox.offsetWidth+this.objBox.scrollLeft?a.offsetLeft>this.objBox.scrollLeft&&(g=a.offsetLeft-5):a.offsetLeft<this.objBox.scrollLeft&&(d-=a.offsetWidth* 
2/3,d<this.objBox.scrollLeft&&(g=a.offsetLeft-5));if(g&&!b)this.objBox.scrollLeft=g}if(a.offsetHeight)d=a.offsetTop;else var h=this._realfake?this._fake.rowsAr[a.parentNode.idd]:a.parentNode,d=this.rowsBuffer._dhx_find(h)*this._srdh;var l=d+a.offsetHeight+38;if(l>this.objBox.offsetHeight+this.objBox.scrollTop)var k=d;else d<this.objBox.scrollTop&&(k=d-5);if(k)this.objBox.scrollTop=k}catch(m){}};this.editCell=function(){if(!(this.editor&&this.cell==this.editor.cell)){this.editStop();if(this.isEditable!= 
!0||!this.cell)return!1;var a=this.cell;if(a.parentNode._locked)return!1;this.editor=this.cells4(a);if(this.editor!=null){if(this.editor.isDisabled())return this.editor=null,!1;this.callEvent("onEditCell",[0,this.row.idd,this.cell._cellIndex])!=!1&&this.editor.edit?(this._Opera_stop=(new Date).valueOf(),a.className+=" editable",this.editor.edit(),this.callEvent("onEditCell",[1,this.row.idd,this.cell._cellIndex])):this.editor=null}}};this.editStop=function(a){if(_isOpera&&this._Opera_stop){if(this._Opera_stop* 
1+50>(new Date).valueOf())return;this._Opera_stop=null}if(this.editor&&this.editor!=null)if(this.editor.cell.className=this.editor.cell.className.replace("editable",""),a){var b=this.editor.val;this.editor.detach();this.editor.setValue(b);this.editor=null;this.callEvent("onEditCancel",[this.row.idd,this.cell._cellIndex,b])}else{if(this.editor.detach())this.cell.wasChanged=!0;var c=this.editor;this.editor=null;var d=this.callEvent("onEditCell",[2,this.row.idd,this.cell._cellIndex,c.getValue(),c.val]); 
if(typeof d=="string"||typeof d=="number")c[c.setImage?"setLabel":"setValue"](d);else if(!d)c[c.setImage?"setLabel":"setValue"](c.val);this._ahgr&&this.multiLine&&this.setSizes()}};this._nextRowCell=function(a,b,c){a=this._nextRow((this._groups?this.rowsCol:this.rowsBuffer)._dhx_find(a),b);return!a?null:a.childNodes[a._childIndexes?a._childIndexes[c]:c]};this._getNextCell=function(a,b,c){var a=a||this.cell,d=a.parentNode;this._tabOrder?(c=this._tabOrder[a._cellIndex],typeof c!="undefined"&&(a=c<0? 
this._nextRowCell(d,b,Math.abs(c)-1):d.childNodes[c])):(c=a._cellIndex+b,c>=0&&c<this._cCount?(d._childIndexes&&(c=d._childIndexes[a._cellIndex]+b),a=d.childNodes[c]):a=this._nextRowCell(d,b,b==1?0:this._cCount-1));return!a?(b==1&&this.tabEnd&&(this.tabEnd.focus(),this.tabEnd.focus(),this.setActive(!1)),b==-1&&this.tabStart&&(this.tabStart.focus(),this.tabStart.focus(),this.setActive(!1)),null):a.style.display!="none"&&(!this.smartTabOrder||!this.cells(a.parentNode.idd,a._cellIndex).isDisabled())? 
a:this._getNextCell(a,b)};this._nextRow=function(a,b){var c=this.render_row(a+b);return!c||c==-1?null:c&&c.style.display=="none"?this._nextRow(a+b,b):c};this.scrollPage=function(a){if(this.rowsBuffer.length){var b=this._realfake?this._fake:this,c=Math.floor((b._r_select||this.getRowIndex(this.row.idd)||0)+a*this.objBox.offsetHeight/(this._srdh||20));c<0&&(c=0);c>=this.rowsBuffer.length&&(c=this.rowsBuffer.length-1);if(this._srnd&&!this.rowsBuffer[c]){this.objBox.scrollTop+=Math.floor(a*this.objBox.offsetHeight/ 
(this._srdh||20))*(this._srdh||20);if(this._fake)this._fake.objBox.scrollTop=this.objBox.scrollTop;b._r_select=c}else{this.selectCell(c,this.cell._cellIndex,!0,!1,!1,this.multiLine||this._srnd);if(!this.multiLine&&!this._srnd&&!this._realfake&&(this.objBox.scrollTop=this.getRowById(this.getRowId(c)).offsetTop,this._fake))this._fake.objBox.scrollTop=this.objBox.scrollTop;b._r_select=null}}};this.doKey=function(a){if(!a)return!0;if((a.target||a.srcElement).value!==window.undefined){var b=a.target|| 
a.srcElement;if(!b.parentNode||b.parentNode.className.indexOf("editable")==-1)return!0}if(globalActiveDHTMLGridObject&&this!=globalActiveDHTMLGridObject)return globalActiveDHTMLGridObject.doKey(a);if(this.isActive==!1)return!0;if(this._htkebl)return!0;if(!this.callEvent("onKeyPress",[a.keyCode,a.ctrlKey,a.shiftKey,a]))return!1;var c="k"+a.keyCode+"_"+(a.ctrlKey?1:0)+"_"+(a.shiftKey?1:0);if(this.cell){if(this._key_events[c]){if(!1===this._key_events[c].call(this))return!0;a.preventDefault&&a.preventDefault(); 
a.cancelBubble=!0;return!1}this._key_events.k_other&&this._key_events.k_other.call(this,a)}return!0};this.selectRow=function(a,b,c,d){typeof a!="object"&&(a=this.render_row(a));this.selectCell(a,0,b,c,!1,d)};this.wasDblClicked=function(a){var b=this.getFirstParentOfType(_isIE?a.srcElement:a.target,"TD");if(b){var c=b.parentNode.idd;return this.callEvent("onRowDblClicked",[c,b._cellIndex,a])}};this._onHeaderClick=function(a,b){var c=this.grid,b=b||c.getFirstParentOfType(_isIE?event.srcElement:a.target, 
"TD");if(this.grid.resized==null){if(!this.grid.callEvent("onHeaderClick",[b._cellIndexS,a||window.event]))return!1;c.sortField(b._cellIndexS,!1,b)}this.grid.resized=null};this.deleteSelectedRows=function(){var a=this.selectedRows.length;if(a!=0){var b=this.selectedRows;this.selectedRows=dhtmlxArray();for(var c=a-1;c>=0;c--){var d=b[c];if(this.deleteRow(d.idd,d)){if(d==this.row)var g=c}else this.selectedRows[this.selectedRows.length]=d}if(g)try{g+1>this.rowsCol.length&&g--,this.selectCell(g,0,!0)}catch(h){this.cell= 
this.row=null}}};this.getSelectedRowId=function(){for(var a=[],b={},c=0;c<this.selectedRows.length;c++){var d=this.selectedRows[c].idd;b[d]||(a[a.length]=d,b[d]=!0)}return a.length==0?null:a.join(this.delim)};this.getSelectedCellIndex=function(){return this.cell!=null?this.cell._cellIndex:-1};this.getColWidth=function(a){return parseInt(this.cellWidthPX[a])};this.setColWidth=function(a,b){if(b=="*")this.initCellWidth[a]="*";else{if(this._hrrar[a])return;this.cellWidthType=="px"?this.cellWidthPX[a]= 
parseInt(b):this.cellWidthPC[a]=parseInt(b)}this.setSizes()};this.getRowIndex=function(a){for(var b=0;b<this.rowsBuffer.length;b++)if(this.rowsBuffer[b]&&this.rowsBuffer[b].idd==a)return b;return-1};this.getRowId=function(a){return this.rowsBuffer[a]?this.rowsBuffer[a].idd:this.undefined};this.setRowId=function(a,b){this.changeRowId(this.getRowId(a),b)};this.changeRowId=function(a,b){if(a!=b){var c=this.rowsAr[a];c.idd=b;this.UserData[a]&&(this.UserData[b]=this.UserData[a],this.UserData[a]=null); 
if(this._h2&&this._h2.get[a])this._h2.get[b]=this._h2.get[a],this._h2.get[b].id=b,delete this._h2.get[a];this.rowsAr[a]=null;this.rowsAr[b]=c;for(var d=0;d<c.childNodes.length;d++)if(c.childNodes[d]._code)c.childNodes[d]._code=this._compileSCL(c.childNodes[d]._val,c.childNodes[d]);if(this._mat_links&&this._mat_links[a]){var g=this._mat_links[a];delete this._mat_links[a];for(var h in g)for(d=0;d<g[h].length;d++)this._compileSCL(g[h][d].original,g[h][d])}this.callEvent("onRowIdChange",[a,b])}};this.setColumnIds= 
function(a){this.columnIds=a.split(this.delim)};this.setColumnId=function(a,b){this.columnIds[a]=b};this.getColIndexById=function(a){for(var b=0;b<this.columnIds.length;b++)if(this.columnIds[b]==a)return b};this.getColumnId=function(a){return this.columnIds[a]};this.getColLabel=this.getColumnLabel=function(a,b,c){for(var d=(c||this.hdr).rows[(b||0)+1],g=0;g<d.cells.length;g++)if(d.cells[g]._cellIndexS==a)return _isIE?d.cells[g].innerText:d.cells[g].textContent;return""};this.getFooterLabel=function(a, 
b){return this.getColumnLabel(a,b,this.ftr)};this.setRowTextBold=function(a){var b=this.getRowById(a);if(b)b.style.fontWeight="bold"};this.setRowTextStyle=function(a,b){var c=this.getRowById(a);if(c)for(var d=0;d<c.childNodes.length;d++){var g=c.childNodes[d]._attrs.style||"";this._hrrar&&this._hrrar[d]&&(g="display:none;");c.childNodes[d].style.cssText=g+"width:"+c.childNodes[d].style.width+";"+b}};this.setRowColor=function(a,b){for(var c=this.getRowById(a),d=0;d<c.childNodes.length;d++)c.childNodes[d].bgColor= 
b};this.setCellTextStyle=function(a,b,c){var d=this.getRowById(a);if(d){var g=d.childNodes[d._childIndexes?d._childIndexes[b]:b];if(g){var h="";this._hrrar&&this._hrrar[b]&&(h="display:none;");g.style.cssText=h+"width:"+g.style.width+";"+c}}};this.setRowTextNormal=function(a){var b=this.getRowById(a);if(b)b.style.fontWeight="normal"};this.doesRowExist=function(a){return this.getRowById(a)!=null?!0:!1};this.getColumnsNum=function(){return this._cCount};this.moveRowUp=function(a){var b=this.getRowById(a); 
if(this.isTreeGrid())return this.moveRowUDTG(a,-1);var c=this.rowsCol._dhx_find(b);if(b.previousSibling&&c!=0){b.parentNode.insertBefore(b,b.previousSibling);this.rowsCol._dhx_swapItems(c,c-1);this.setSizes();var d=this.rowsBuffer._dhx_find(b);this.rowsBuffer._dhx_swapItems(d,d-1);this._cssEven&&this._fixAlterCss(c-1)}};this.moveRowDown=function(a){var b=this.getRowById(a);if(this.isTreeGrid())return this.moveRowUDTG(a,1);var c=this.rowsCol._dhx_find(b);if(b.nextSibling){this.rowsCol._dhx_swapItems(c, 
c+1);b.nextSibling.nextSibling?b.parentNode.insertBefore(b,b.nextSibling.nextSibling):b.parentNode.appendChild(b);this.setSizes();var d=this.rowsBuffer._dhx_find(b);this.rowsBuffer._dhx_swapItems(d,d+1);this._cssEven&&this._fixAlterCss(c)}};this.getCombo=function(a){this.combos[a]||(this.combos[a]=new dhtmlXGridComboObject);return this.combos[a]};this.setUserData=function(a,b,c){a||(a="gridglobaluserdata");this.UserData[a]||(this.UserData[a]=new Hashtable);this.UserData[a].put(b,c)};this.getUserData= 
function(a,b){a||(a="gridglobaluserdata");this.getRowById(a);var c=this.UserData[a];return c?c.get(b):""};this.setEditable=function(a){this.isEditable=convertStringToBoolean(a)};this.selectRowById=function(a,b,c,d){d||(d=!1);this.selectCell(this.getRowById(a),0,d,b,!1,c)};this.clearSelection=function(){this.editStop();for(var a=0;a<this.selectedRows.length;a++){var b=this.rowsAr[this.selectedRows[a].idd];if(b)b.className=b.className.replace(/rowselected/g,"")}this.selectedRows=dhtmlxArray();this.row= 
null;if(this.cell!=null)this.cell.className=this.cell.className.replace(/cellselected/g,""),this.cell=null;this.callEvent("onSelectionCleared",[])};this.copyRowContent=function(a,b){var c=this.getRowById(a);if(this.isTreeGrid())this._copyTreeGridRowContent(c,a,b);else for(var d=0;d<c.cells.length;d++)this.cells(b,d).setValue(this.cells(a,d).getValue());if(!_isIE)this.getRowById(a).cells[0].height=c.cells[0].offsetHeight};this.setFooterLabel=function(a,b,c){return this.setColumnLabel(a,b,c,this.ftr)}; 
this.setColumnLabel=function(a,b,c,d){var g=(d||this.hdr).rows[c||1],h=g._childIndexes?g._childIndexes[a]:a;if(g.cells[h]){if(this.useImagesInHeader){g.cells[h].style.textAlign="left";g.cells[h].innerHTML="<img src='"+this.imgURL+""+b+"' onerror='this.src = /""+this.imgURL+"imageloaderror.gif/"'>";var l=new Image;l.src=this.imgURL+""+b.replace(/(/.[a-z]+)/,".des$1");this.preloadImagesAr[this.preloadImagesAr.length]=l;var k=new Image;k.src=this.imgURL+""+b.replace(/(/.[a-z]+)/,".asc$1");this.preloadImagesAr[this.preloadImagesAr.length]= 
k}else{var m="<div class='hdrcell'>";if(b.indexOf("img:[")!=-1){var n=b.replace(/.*/[([^>]+)/].*/,"$1"),b=b.substr(b.indexOf("]")+1,b.length);m+="<img width='18px' height='18px' align='absmiddle' src='"+n+"' hspace='2'>"}m+=b;m+="</div>";g.cells[h].innerHTML=m;if(this._hstyles[h])g.cells[h].style.cssText=this._hstyles[h]}if((b||"").indexOf("#")!=-1){var o=b.match(/(^|{)#([^}]+)(}|$)/);if(o){var p="_in_header_"+o[2];if(this[p])this[p](this.forceDivInHeader?g.cells[h].firstChild:g.cells[h],h,b.split(o[0]))}}}}; 
this.setColLabel=function(a,b,c,d){return this.setColumnLabel(a,b,(c||0)+1,d)};this.clearAll=function(a){if(this.obj.rows[0]){if(this._h2&&(this._h2=new dhtmlxHierarchy,this._fake))this._realfake?this._h2=this._fake._h2:this._fake._h2=this._h2;this.limit=this._limitC=0;this.editStop(!0);this._dLoadTimer&&window.clearTimeout(this._dLoadTimer);if(this._dload)this.objBox.scrollTop=0,this.limit=this._limitC||0,this._initDrF=!0;for(var b=this.rowsCol.length,b=this.obj.rows.length,c=b-1;c>0;c--){var d= 
this.obj.rows[c];d.parentNode.removeChild(d)}if(a){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(c=this.hdr.rows.length-1;c>=0;c--)d=this.hdr.rows[c],d.parentNode.removeChild(d);if(this.ftr)this.ftr.parentNode.removeChild(this.ftr),this.ftr=null;this._aHead=this.ftr=this.cellWidth=this._aFoot=null;this.cellType=dhtmlxArray();this._hrrar=[];this.columnIds=[];this.combos=[];this._strangeParams=[];this.defVal=[];this._ivizcol=null}this.cell=this.row=null;this.rowsCol= 
dhtmlxArray();this.rowsAr={};this._RaSeCol=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn||this._srnd)this.xmlFileUrl="";this.pagingOn&&this.changePage(1);this._contextCallTimer&&window.clearTimeout(this._contextCallTimer);this._sst&&this.enableStableSorting(!0);this._fillers=this.undefined;this.setSortImgState(!1);this.setSizes();this.callEvent("onClearAll",[])}};this.sortField=function(a,b,c){if(this.getRowsNum()==0)return!1;var d=this.hdr.rows[0].cells[a]; 
if(d&&d.tagName=="TH"&&this.fldSort.length-1>=d._cellIndex&&this.fldSort[d._cellIndex]!="na"){var g=this.getSortingState(),h=g[0]==a&&g[1]=="asc"?"des":"asc";if(this.callEvent("onBeforeSorting",[a,this.fldSort[a],h])){this.sortImg.src=this.imgURL+"sort_"+(h=="asc"?"asc":"desc")+".gif";if(this.useImagesInHeader){var l=this.hdr.rows[1].cells[d._cellIndex].firstChild;if(this.fldSorted!=null){var k=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;k.src=k.src.replace(/(/.asc/.)|(/.des/.)/, 
".")}l.src=l.src.replace(/(/.[a-z]+)$/,"."+h+"$1")}this.sortRows(d._cellIndex,this.fldSort[d._cellIndex],h);this.fldSorted=d;this.r_fldSorted=c;var m=this.hdr.rows[1],m=c.parentNode,n=m._childIndexes?m._childIndexes[d._cellIndex]:d._cellIndex;this.setSortImgPos(!1,!1,!1,c)}}};this.setCustomSorting=function(a,b){if(!this._customSorts)this._customSorts=[];this._customSorts[b]=typeof a=="string"?eval(a):a;this.fldSort[b]="cus"};this.enableHeaderImages=function(a){this.useImagesInHeader=a};this.setHeader= 
function(a,b,c){for(var d=typeof a!="object"?this._eSplit(a):[].concat(a),g=[],h=new dhtmlxArray(0),l=[],k=[],m=[],n=0;n<d.length;n++)g[g.length]=Math.round(100/d.length),h[h.length]="ed",l[l.length]="left",k[k.length]="middle",m[m.length]="na";this.splitSign=b||"#cspan";this.hdrLabels=d;this.cellWidth=g;this.initCellWidth.length||this.setInitWidthsP(g.join(this.delim),!0);this.cellType=h;this.cellAlign=l;this.cellVAlign=k;this.fldSort=m;this._hstyles=c||[]};this._eSplit=function(a){if(![].push)return a.split(this.delim); 
var b="r"+(new Date).valueOf(),c=this.delim.replace(/([/|/+/*/^])/g,"//$1");return(a||"").replace(RegExp(c,"g"),b).replace(RegExp("////"+b,"g"),this.delim).split(b)};this.getColType=function(a){return this.cellType[a]};this.getColTypeById=function(a){return this.cellType[this.getColIndexById(a)]};this.setColTypes=function(a){this.cellType=dhtmlxArray(a.split(this.delim));this._strangeParams=[];for(var b=0;b<this.cellType.length;b++){if(this.cellType[b].indexOf("[")!=-1){var c=this.cellType[b].split(/[/[/]]+/g); 
this.cellType[b]=c[0];this.defVal[b]=c[1];c[1].indexOf("=")==0&&(this.cellType[b]="math",this._strangeParams[b]=c[0])}window["eXcell_"+this.cellType[b]]||dhtmlxError.throwError("Configuration","Incorrect cell type: "+this.cellType[b],[this,this.cellType[b]])}};this.setColSorting=function(a){this.fldSort=a.split(this.delim);for(var b=0;b<this.fldSort.length;b++)if(this.fldSort[b].length>4&&typeof window[this.fldSort[b]]=="function"){if(!this._customSorts)this._customSorts=[];this._customSorts[b]=window[this.fldSort[b]]; 
this.fldSort[b]="cus"}};this.setColAlign=function(a){this.cellAlign=a.split(this.delim);for(var b=0;b<this.cellAlign.length;b++)this.cellAlign[b]=this.cellAlign[b]._dhx_trim()};this.setColVAlign=function(a){this.cellVAlign=a.split(this.delim)};this.setNoHeader=function(a){this.noHeader=convertStringToBoolean(a)};this.showRow=function(a){this.getRowById(a);this._h2&&this.openItem(this._h2.get[a].parent.id);for(var b=this.getRowById(a).childNodes[0];b&&b.style.display=="none";)b=b.nextSibling;b&&this.moveToVisible(b, 
!0)};this.setStyle=function(a,b,c,d){this.ssModifier=[a,b,c,c,d];for(var g=["#"+this.entBox.id+" table.hdr td","#"+this.entBox.id+" table.obj td","#"+this.entBox.id+" table.obj tr.rowselected td.cellselected","#"+this.entBox.id+" table.obj td.cellselected","#"+this.entBox.id+" table.obj tr.rowselected td"],h=0;!_isIE;){try{var l=document.styleSheets[h].cssRules.length}catch(k){h++;continue}break}for(var m=0;m<g.length;m++)this.ssModifier[m]&&(_isIE?document.styleSheets[0].addRule(g[m],this.ssModifier[m]): 
document.styleSheets[h].insertRule(g[m]+(" { "+this.ssModifier[m]+" }"),document.styleSheets[h].cssRules.length))};this.setColumnColor=function(a){this.columnColor=a.split(this.delim)};this.enableAlterCss=function(a,b,c,d){(a||b)&&this.attachEvent("onGridReconstructed",function(){this._fixAlterCss();this._fake&&this._fake._fixAlterCss()});this._cssSP=c;this._cssSU=d;this._cssEven=a;this._cssUnEven=b};this._fixAlterCss=function(a){if(this._h2&&(this._cssSP||this._cssSU))return this._fixAlterCssTGR(a); 
if(this._cssEven||this._cssUnEven)for(var b=a=a||0,c=a;c<this.rowsCol.length;c++)if(this.rowsCol[c]&&this.rowsCol[c].style.display!="none")this.rowsCol[c]._cntr?b=1:(this.rowsCol[c].className=this.rowsCol[c].className.indexOf("rowselected")!=-1?b%2==1?this._cssUnEven+" rowselected "+(this.rowsCol[c]._css||""):this._cssEven+" rowselected "+(this.rowsCol[c]._css||""):b%2==1?this._cssUnEven+" "+(this.rowsCol[c]._css||""):this._cssEven+" "+(this.rowsCol[c]._css||""),b++)};this.clearChangedState=function(){for(var a= 
0;a<this.rowsCol.length;a++){var b=this.rowsCol[a];if(b&&b.childNodes)for(var c=b.childNodes.length,d=0;d<c;d++)b.childNodes[d].wasChanged=!1}};this.getChangedRows=function(a){var b=[];this.forEachRow(function(c){var d=this.rowsAr[c];if(d.tagName=="TR"){var g=d.childNodes.length;if(a&&d._added)b[b.length]=d.idd;else for(var h=0;h<g;h++)if(d.childNodes[h].wasChanged){b[b.length]=d.idd;break}}});return b.join(this.delim)};this._sAll=this._sUDa=!1;this.setSerializationLevel=function(a,b,c,d,g,h){this._sUDa= 
a;this._sAll=b;this._sConfig=c;this._chAttr=d;this._onlChAttr=g;this._asCDATA=h};this.setSerializableColumns=function(a){if(a){this._srClmn=(a||"").split(",");for(var b=0;b<this._srClmn.length;b++)this._srClmn[b]=convertStringToBoolean(this._srClmn[b])}else this._srClmn=null};this._serialise=function(){this.editStop();var a=[],b="</"+this.xml.s_row+">";if(this.isTreeGrid())this._h2.forEachChildF(0,function(b){var c=this._serializeRow(this.render_row_tree(-1,b.id));a.push(c);return c?!0:!1},this,function(){a.push(b)}); 
else for(var c=0;c<this.rowsBuffer.length;c++)if(this.rowsBuffer[c]&&(!this._chAttr||!this.rowsBuffer[c]._locator)){var d=this._serializeRow(this.render_row(c));a.push(d);d&&a.push(b)}return[a.join("")]};this._serializeRow=function(a,b){var c=[],d=this.xml.row_attrs,g=this.xml.cell_attrs;c.push("<"+this.xml.s_row);c.push(" id='"+a.idd+"'");this._sAll&&this.selectedRows._dhx_find(a)!=-1&&c.push(" selected='1'");this._h2&&this._h2.get[a.idd].state=="minus"&&c.push(" open='1'");if(d.length)for(b=0;b< 
d.length;b++)c.push(" "+d[b]+"='"+a._attrs[d[b]]+"'");c.push(">");if(this._sUDa&&this.UserData[a.idd]){keysAr=this.UserData[a.idd].getKeys();for(var h=0;h<keysAr.length;h++)c.push("<userdata name='"+keysAr[h]+"'>"+(this._asCDATA?"<![CDATA[":"")+this.UserData[a.idd].get(keysAr[h])+(this._asCDATA?"]]/>":"")+"</userdata>")}for(var l=!1,k=0;k<this._cCount;k++)if(!this._srClmn||this._srClmn[k]){var m=this.cells3(a,k);c.push("<cell");if(g.length)for(b=0;b<g.length;b++)c.push(" "+g[b]+"='"+m.cell._attrs[g[b]]+ 
"'");zxVal=m[this._agetm]();this._asCDATA&&(zxVal="<![CDATA["+zxVal+"]]/>");this._ecspn&&m.cell.colSpan&&m.cell.colSpan>1&&c.push(' colspan="'+m.cell.colSpan+'" ');this._chAttr?m.wasChanged()&&(c.push(' changed="1"'),l=!0):this._onlChAttr&&m.wasChanged()&&(l=!0);this._sAll&&this.cellType[k]=="tree"?c.push((this._h2?" image='"+this._h2.get[a.idd].image+"'":"")+">"+zxVal+"</cell>"):c.push(">"+zxVal+"</cell>");if(this._ecspn&&m.cell.colSpan)for(var n=0;n<m.cell.colSpan-1;n++)c.push("<cell/>"),k++}return this._onlChAttr&& 
!l&&!a._added?"":c.join("")};this._serialiseConfig=function(){for(var a="<head>",b=0;b<this.hdr.rows[0].cells.length;b++)if(!this._srClmn||this._srClmn[b]){var c=this.fldSort[b];c=="cus"&&(c=this._customSorts[b].toString(),c=c.replace(/function[/ ]*/,"").replace(//([^/f]*/,""));a+="<column width='"+this.getColWidth(b)+"' align='"+this.cellAlign[b]+"' type='"+this.cellType[b]+"' sort='"+(c||"na")+"' color='"+this.columnColor[b]+"'"+(this.columnIds[b]?" id='"+this.columnIds[b]+"'":"")+">";a+=this._asCDATA? 
"<![CDATA["+this.getHeaderCol(b)+"]]/>":this.getHeaderCol(b);var d=this.getCombo(b);if(d)for(var g=0;g<d.keys.length;g++)a+="<option value='"+d.keys[g]+"'>"+d.values[g]+"</option>";a+="</column>"}return a+="</head>"};this.serialize=function(){var a='<?xml version="1.0"?><rows>';this._agetm=this._mathSerialization?"getMathValue":"getValue";if(this._sUDa&&this.UserData.gridglobaluserdata)for(var b=this.UserData.gridglobaluserdata.getKeys(),c=0;c<b.length;c++)a+="<userdata name='"+b[c]+"'>"+this.UserData.gridglobaluserdata.get(b[c])+ 
"</userdata>";this._sConfig&&(a+=this._serialiseConfig());a+=this._serialise();a+="</rows>";return a};this.getPosition=function(a,b){if(!b){var c=getOffset(a);return[c.left,c.top]}for(var b=b||document.body,d=a,g=0,h=0;d&&d!=b;)g+=d.offsetLeft-d.scrollLeft,h+=d.offsetTop-d.scrollTop,d=d.offsetParent;b==document.body&&(_isIE?(h+=document.body.offsetTop||document.documentElement.offsetTop,g+=document.body.offsetLeft||document.documentElement.offsetLeft):_isFF||(g+=document.body.offsetLeft,h+=document.body.offsetTop)); 
return[g,h]};this.getFirstParentOfType=function(a,b){for(;a&&a.tagName!=b&&a.tagName!="BODY";)a=a.parentNode;return a};this.objBox.onscroll=function(){this.grid._doOnScroll()};this.objBox.ontouchend=function(){this.hdrBox.scrollLeft=this.objBox.scrollLeft};this.hdrBox.onscroll=function(){if(!this._try_header_sync){this._try_header_sync=!0;if(this.grid.objBox.scrollLeft!=this.scrollLeft)this.grid.objBox.scrollLeft=this.scrollLeft;this._try_header_sync=!1}};if(!_isOpera||_OperaRv>8.5)this.hdr.onmousemove= 
function(a){this.grid.changeCursorState(a||window.event)},this.hdr.onmousedown=function(a){return this.grid.startColResize(a||window.event)};this.obj.onmousemove=this._drawTooltip;this.objBox.onclick=function(a){(a||event).cancelBubble=!0};this.obj.onclick=function(a){this.grid._doClick(a||window.event);this.grid._sclE?this.grid.editCell(a||window.event):this.grid.editStop();(a||event).cancelBubble=!0};_isMacOS?this.entBox.oncontextmenu=function(a){a.cancelBubble=!0;a.returnValue=!1;var b=this.grid; 
if(b._realfake)b=b._fake;return b._doContClick(a||window.event)}:(this.entBox.onmousedown=function(a){return this.grid._doContClick(a||window.event)},this.entBox.oncontextmenu=function(a){if(this.grid._ctmndx)(a||event).cancelBubble=!0;return!this.grid._ctmndx});this.obj.ondblclick=function(a){if(!this.grid.wasDblClicked(a||window.event))return!1;if(this.grid._dclE){var b=this.grid.getFirstParentOfType(_isIE?event.srcElement:a.target,"TR");b==this.grid.row&&this.grid.editCell(a||window.event)}(a|| 
event).cancelBubble=!0;if(_isOpera)return!1};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){c._onHeaderClick.apply({grid:c},[null,c.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown)dhtmlxEvent(document,"keydown",function(a){if(globalActiveDHTMLGridObject)return globalActiveDHTMLGridObject.doKey(a||window.event)}),document.body._dhtmlxgrid_onkeydown=!0;dhtmlxEvent(document.body,"click",function(){c.editStop&&c.editStop();c.isActive&& 
c.setActive(!1)});if(this.entBox.style.height.toString().indexOf("%")!=-1)this._delta_y=this.entBox.style.height;if(this.entBox.style.width.toString().indexOf("%")!=-1)this._delta_x=this.entBox.style.width;(this._delta_x||this._delta_y)&&this._setAutoResize();this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId; 
this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=this.enableAutoHeight;this.getUID=this.uid;dhtmlx.image_path&&this.setImagePath(dhtmlx.image_path);dhtmlx.skin&&this.setSkin(dhtmlx.skin);return this} 
dhtmlXGridObject.prototype={getRowAttribute:function(a,b){return this.getRowById(a)._attrs[b]},setRowAttribute:function(a,b,c){this.getRowById(a)._attrs[b]=c},isTreeGrid:function(){return this.cellType._dhx_find("tree")!=-1},setRowHidden:function(a,b){var c=convertStringToBoolean(b),d=this.getRowById(a);if(d){d.expand===""&&this.collapseKids(d);if(b&&d.style.display!="none"){d.style.display="none";var e=this.selectedRows._dhx_find(d);if(e!=-1){d.className=d.className.replace("rowselected","");for(var j= 
0;j<d.childNodes.length;j++)d.childNodes[j].className=d.childNodes[j].className.replace(/cellselected/g,"");this.selectedRows._dhx_removeAt(e)}this.callEvent("onGridReconstructed",[])}if(!b&&d.style.display=="none")d.style.display="",this.callEvent("onGridReconstructed",[]);this.callEvent("onRowHide",[a,b]);this.setSizes()}},setColumnHidden:function(a,b){if(!this.hdr.rows.length){if(!this._ivizcol)this._ivizcol=[];return this._ivizcol[a]=b}if(this.fldSorted&&this.fldSorted.cellIndex==a&&b)this.sortImg.style.display= 
"none";var c=convertStringToBoolean(b);if(c){if(this._hrrar){if(this._hrrar[a])return}else this._hrrar=[];this._hrrar[a]="display:none;";this._hideShowColumn(a,"none")}else{if(!this._hrrar||!this._hrrar[a])return;this._hrrar[a]="";this._hideShowColumn(a,"")}if(this.fldSorted&&this.fldSorted.cellIndex==a&&!b)this.sortImg.style.display="inline";this.setSortImgPos();this.callEvent("onColumnHidden",[a,b])},isColumnHidden:function(a){return this._hrrar&&this._hrrar[a]?!0:!1},setColumnsVisibility:function(a){if(a)this._ivizcol= 
a.split(this.delim);if(this.hdr.rows.length&&this._ivizcol)for(var b=0;b<this._ivizcol.length;b++)this.setColumnHidden(b,this._ivizcol[b])},_fixHiddenRowsAll:function(a,b,c,d,e){for(var e=e||"_cellIndex",j=a.rows.length,i=0;i<j;i++){var f=a.rows[i].childNodes;if(f.length!=this._cCount)for(var g=0;g<f.length;g++){if(f[g][e]==b){f[g].style[c]=d;break}}else f[b].style[c]=d}},_hideShowColumn:function(a,b){var c=a;this.hdr.rows[1]&&this.hdr.rows[1]._childIndexes&&this.hdr.rows[1]._childIndexes[a]!=a&& 
(c=this.hdr.rows[1]._childIndexes[a]);if(b=="none"){this.hdr.rows[0].cells[a]._oldWidth=this.hdr.rows[0].cells[a].style.width||this.initCellWidth[a]+"px";this.hdr.rows[0].cells[a]._oldWidthP=this.cellWidthPC[a];this.obj.rows[0].cells[a].style.width="0px";var d={rows:[this.obj.rows[0]]};this.forEachRow(function(a){this.rowsAr[a].tagName=="TR"&&d.rows.push(this.rowsAr[a])});this._fixHiddenRowsAll(d,a,"display","none");this.isTreeGrid()&&this._fixHiddenRowsAllTG(a,"none");(_isOpera&&_OperaRv<9||_isKHTML|| 
_isFF)&&this._fixHiddenRowsAll(this.hdr,a,"display","none","_cellIndexS");this.ftr&&this._fixHiddenRowsAll(this.ftr.childNodes[0],a,"display","none");this._fixHiddenRowsAll(this.hdr,a,"whiteSpace","nowrap","_cellIndexS");if(!this.cellWidthPX.length&&!this.cellWidthPC.length)this.cellWidthPX=[].concat(this.initCellWidth);this.cellWidthPX[a]&&(this.cellWidthPX[a]=0);this.cellWidthPC[a]&&(this.cellWidthPC[a]=0)}else if(this.hdr.rows[0].cells[a]._oldWidth){var e=this.hdr.rows[0].cells[a];(_isOpera||_isKHTML|| 
_isFF)&&this._fixHiddenRowsAll(this.hdr,a,"display","","_cellIndexS");this.ftr&&this._fixHiddenRowsAll(this.ftr.childNodes[0],a,"display","");d={rows:[this.obj.rows[0]]};this.forEachRow(function(a){this.rowsAr[a].tagName=="TR"&&d.rows.push(this.rowsAr[a])});this._fixHiddenRowsAll(d,a,"display","");this.isTreeGrid()&&this._fixHiddenRowsAllTG(a,"");this._fixHiddenRowsAll(this.hdr,a,"whiteSpace","normal","_cellIndexS");if(e._oldWidthP)this.cellWidthPC[a]=e._oldWidthP;e._oldWidth&&(this.cellWidthPX[a]= 
parseInt(e._oldWidth))}this.setSizes();if(!_isIE&&!_isFF)this.obj.border=1,this.obj.border=0},enableColSpan:function(a){this._ecspn=convertStringToBoolean(a)},enableRowsHover:function(a,b){this._unsetRowHover(!1,!0);this._hvrCss=b;if(convertStringToBoolean(a)){if(!this._elmnh)this.obj._honmousemove=this.obj.onmousemove,this.obj.onmousemove=this._setRowHover,_isIE?this.obj.onmouseleave=this._unsetRowHover:this.obj.onmouseout=this._unsetRowHover,this._elmnh=!0}else if(this._elmnh)this.obj.onmousemove= 
this.obj._honmousemove,_isIE?this.obj.onmouseleave=null:this.obj.onmouseout=null,this._elmnh=!1},enableEditEvents:function(a,b,c){this._sclE=convertStringToBoolean(a);this._dclE=convertStringToBoolean(b);this._f2kE=convertStringToBoolean(c)},enableLightMouseNavigation:function(a){if(convertStringToBoolean(a)){if(!this._elmn)this.entBox._onclick=this.entBox.onclick,this.entBox.onclick=function(){return!0},this.obj._onclick=this.obj.onclick,this.obj.onclick=function(a){var c=this.grid.getFirstParentOfType(a? 
a.target:event.srcElement,"TD");if(c)this.grid.editStop(),this.grid.doClick(c),this.grid.editCell(),(a||event).cancelBubble=!0},this.obj._onmousemove=this.obj.onmousemove,this.obj.onmousemove=this._autoMoveSelect,this._elmn=!0}else if(this._elmn)this.entBox.onclick=this.entBox._onclick,this.obj.onclick=this.obj._onclick,this.obj.onmousemove=this.obj._onmousemove,this._elmn=!1},_unsetRowHover:function(a,b){that=b?this:this.grid;if(that._lahRw&&that._lahRw!=b){for(var c=0;c<that._lahRw.childNodes.length;c++)that._lahRw.childNodes[c].className= 
that._lahRw.childNodes[c].className.replace(that._hvrCss,"");that._lahRw=null}},_setRowHover:function(a){var b=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(b&&b.parentNode!=this.grid._lahRw){this.grid._unsetRowHover(0,b);b=b.parentNode;if(!b.idd||b.idd=="__filler__")return;for(var c=0;c<b.childNodes.length;c++)b.childNodes[c].className+=" "+this.grid._hvrCss;this.grid._lahRw=b}this._honmousemove(a)},_autoMoveSelect:function(a){if(!this.grid.editor){var b=this.grid.getFirstParentOfType(a? 
a.target:event.srcElement,"TD");b.parentNode.idd&&this.grid.doClick(b,!0,0)}this._onmousemove(a)},enableDistributedParsing:function(a,b,c){convertStringToBoolean(a)?(this._ads_count=b||10,this._ads_time=c||250):this._ads_count=0},destructor:function(){this.editStop(!0);if(this._sizeTime)this._sizeTime=window.clearTimeout(this._sizeTime);this.entBox.className=(this.entBox.className||"").replace(/gridbox.*/,"");if(this.formInputs)for(var a=0;a<this.formInputs.length;a++)this.parentForm.removeChild(this.formInputs[a]); 
var b;this.xmlLoader=this.xmlLoader.destructor();for(a=0;a<this.rowsCol.length;a++)if(this.rowsCol[a])this.rowsCol[a].grid=null;for(a in this.rowsAr)this.rowsAr[a]&&(this.rowsAr[a]=null);this.rowsCol=new dhtmlxArray;this.rowsAr={};this.entBox.innerHTML="";var c=function(){};this.setSizes=this._update_srnd_view=this.callEvent=this.entBox.onclick=this.entBox.onmousedown=this.entBox.onbeforeactivate=this.entBox.onbeforedeactivate=this.entBox.onbeforedeactivate=this.entBox.onselectstart=c;this.entBox.grid= 
this.objBox.grid=this.hdrBox.grid=this.obj.grid=this.hdr.grid=null;if(this._fake)this.globalBox.innerHTML="",this._fake.setSizes=this._fake._update_srnd_view=this._fake.callEvent=c,this.globalBox.onclick=this.globalBox.onmousedown=this.globalBox.onbeforeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onbeforedeactivate=this.globalBox.onselectstart=c;for(b in this){if(this[b]&&this[b].m_obj)this[b].m_obj=null;this[b]=null}this==globalActiveDHTMLGridObject&&(globalActiveDHTMLGridObject=null); 
return null},getSortingState:function(){var a=[];if(this.fldSorted)a[0]=this.fldSorted._cellIndex,a[1]=this.sortImg.src.indexOf("sort_desc.gif")!=-1?"des":"asc";return a},enableAutoHeight:function(a,b,c){this._ahgr=convertStringToBoolean(a);this._ahgrF=convertStringToBoolean(c);this._ahgrM=b||null;if(arguments.length==1)this.objBox.style.overflowY=a?"hidden":"auto";if(b=="auto")this._ahgrM=null,this._ahgrMA=!0,this._setAutoResize()},enableStableSorting:function(a){this._sst=convertStringToBoolean(a); 
this.rowsCol.stablesort=function(a){for(var c=this.length-1,d=0;d<this.length-1;d++){for(var e=0;e<c;e++)if(a(this[e],this[e+1])>0){var j=this[e];this[e]=this[e+1];this[e+1]=j}c--}}},enableKeyboardSupport:function(a){this._htkebl=!convertStringToBoolean(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(){},enableTooltips:function(a){this._enbTts=a.split(",");for(var b=0;b<this._enbTts.length;b++)this._enbTts[b]=convertStringToBoolean(this._enbTts[b])},enableResizing:function(a){this._drsclmn= 
a.split(",");for(var b=0;b<this._drsclmn.length;b++)this._drsclmn[b]=convertStringToBoolean(this._drsclmn[b])},setColumnMinWidth:function(a,b){if(arguments.length==2){if(!this._drsclmW)this._drsclmW=[];this._drsclmW[b]=a}else this._drsclmW=a.split(",")},enableCellIds:function(a){this._enbCid=convertStringToBoolean(a)},lockRow:function(a,b){var c=this.getRowById(a);if(c)c._locked=convertStringToBoolean(b),this.cell&&this.cell.parentNode.idd==a&&this.editStop()},_getRowArray:function(a){for(var b=[], 
c=0;c<a.childNodes.length;c++){var d=this.cells3(a,c);b[c]=d.getValue()}return b},setDateFormat:function(a,b){this._dtmask=a;this._dtmask_inc=b},setNumberFormat:function(a,b,c,d){var e=a.replace(/[^0/,/.]*/g,""),j=e.indexOf(".");j>-1&&(j=e.length-j-1);var i=e.indexOf(",");i>-1&&(i=e.length-j-2-i);if(typeof c!="string")c=this.i18n.decimal_separator;if(typeof d!="string")d=this.i18n.group_separator;var f=a.split(e)[0],g=a.split(e)[1];this._maskArr[b]=[j,i,f,g,c,d]},_aplNFb:function(a,b){var c=this._maskArr[b]; 
if(!c)return a;var d=parseFloat(a.toString().replace(/[^0-9]*/g,""));a.toString().substr(0,1)=="-"&&(d*=-1);c[0]>0&&(d/=Math.pow(10,c[0]));return d},_aplNF:function(a,b){var c=this._maskArr[b];if(!c)return a;var d=(parseFloat(a)<0?"-":"")+c[2],a=Math.abs(Math.round(parseFloat(a)*Math.pow(10,c[0]>0?c[0]:0))).toString(),a=(a.length<c[0]?Math.pow(10,c[0]+1-a.length).toString().substr(1,c[0]+1)+a.toString():a).split("").reverse();a[c[0]]=(a[c[0]]||"0")+c[4];if(c[1]>0)for(var e=(c[0]>0?0:1)+c[0]+c[1];e< 
a.length;e+=c[1])a[e]+=c[5];return d+a.reverse().join("")+c[3]},_launchCommands:function(a){for(var b=0;b<a.length;b++){for(var c=[],d=0;d<a[b].childNodes.length;d++)if(a[b].childNodes[d].nodeType==1)c[c.length]=a[b].childNodes[d].firstChild.data;this[a[b].getAttribute("command")].apply(this,c)}},_parseHead:function(a){var b=this.xmlLoader.doXPath("./head",a);if(b.length){var c=this.xmlLoader.doXPath("./column",b[0]),d=this.xmlLoader.doXPath("./settings",b[0]),e="setInitWidths",j=!1;if(d[0])for(var i= 
0;i<d[0].childNodes.length;i++)switch(d[0].childNodes[i].tagName){case "colwidth":d[0].childNodes[i].firstChild&&d[0].childNodes[i].firstChild.data=="%"&&(e="setInitWidthsP");break;case "splitat":j=d[0].childNodes[i].firstChild?d[0].childNodes[i].firstChild.data:!1}this._launchCommands(this.xmlLoader.doXPath("./beforeInit/call",b[0]));if(c.length>0){this.hdr.rows.length>0&&this.clearAll(!0);for(var f=[[],[],[],[],[],[],[],[],[]],g=",width,type,align,sort,color,format,hidden,id".split(","),h=["",e, 
"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"],l=0;l<c.length;l++){for(var k=1;k<g.length;k++)f[k].push(c[l].getAttribute(g[k]));f[0].push((c[l].firstChild?c[l].firstChild.data:"").replace(/^/s*((/s/S)*.+)/s*$/gi,"$1"))}this.setHeader(f[0]);for(l=0;l<h.length;l++)if(h[l])this[h[l]](f[l].join(this.delim));for(l=0;l<c.length;l++)if(this.cellType[l].indexOf("co")==0||this.cellType[l]=="clist"){var m=this.xmlLoader.doXPath("./option",c[l]);if(m.length){var n=[];if(this.cellType[l]== 
"clist"){for(k=0;k<m.length;k++)n[n.length]=m[k].firstChild?m[k].firstChild.data:"";this.registerCList(l,n)}else for(var o=this.getCombo(l),k=0;k<m.length;k++)o.put(m[k].getAttribute("value"),m[k].firstChild?m[k].firstChild.data:"")}}else f[6][l]&&(this.cellType[l].toLowerCase().indexOf("calendar")!=-1||this.fldSort[l]=="date"?this.setDateFormat(f[6][l]):this.setNumberFormat(f[6][l],l));this.init();var p=f[7].join(this.delim);this.setColHidden&&p.replace(/,/g,"")!=""&&this.setColHidden(p);j&&this.splitAt&& 
this.splitAt(j)}this._launchCommands(this.xmlLoader.doXPath("./afterInit/call",b[0]))}var r=this.xmlLoader.doXPath("//rows/userdata",a);if(r.length>0){this.UserData.gridglobaluserdata||(this.UserData.gridglobaluserdata=new Hashtable);for(k=0;k<r.length;k++){for(var q="",s=0;s<r[k].childNodes.length;s++)q+=r[k].childNodes[s].nodeValue;this.UserData.gridglobaluserdata.put(r[k].getAttribute("name"),q)}}},getCheckedRows:function(a){var b=[];this.forEachRowA(function(c){this.cells(c,a).getValue()!=0&& 
b.push(c)},!0);return b.join(",")},checkAll:function(){for(var a=arguments.length?arguments[0]:1,b=0;b<this.getColumnsNum();b++)this.getColType(b)=="ch"&&this.setCheckedRows(b,a)},uncheckAll:function(){this.checkAll(0)},setCheckedRows:function(a,b){this.forEachRowA(function(c){this.cells(c,a).isCheckbox()&&this.cells(c,a).setValue(b)})},_drawTooltip:function(a){var b=this.grid.getFirstParentOfType(a?a.target:event.srcElement,"TD");if(!b||this.grid.editor&&this.grid.editor.cell==b)return!0;var c=b.parentNode; 
if(c.idd&&c.idd!="__filler__"){var d=a?a.target:event.srcElement;if(c.idd==window.unknown)return!0;if(!this.grid.callEvent("onMouseOver",[c.idd,b._cellIndex,a||window.event]))return!0;if(this.grid._enbTts&&!this.grid._enbTts[b._cellIndex]){if(d.title)d.title="";return!0}if(!(b._cellIndex>=this.grid._cCount)){var e=this.grid.cells3(c,b._cellIndex);if(e&&e.cell&&e.cell._attrs){if(d._title)e.cell.title="";if(!e.cell._attrs.title)d._title=!0;if(e)d.title=e.cell._attrs.title||(e.getTitle?e.getTitle(): 
(e.getValue()||"").toString().replace(/<[^>]*>/gi,""));return!0}}}},enableCellWidthCorrection:function(a){if(_isFF)this._wcorr=parseInt(a)},getAllRowIds:function(a){for(var b=[],c=0;c<this.rowsBuffer.length;c++)this.rowsBuffer[c]&&b.push(this.rowsBuffer[c].idd);return b.join(a||this.delim)},getAllItemIds:function(){return this.getAllRowIds()},setColspan:function(a,b,c){if(this._ecspn){var d=this.getRowById(a);if(d._childIndexes&&d.childNodes[d._childIndexes[b]]){var e=d._childIndexes[b],j=d.childNodes[e], 
i=j.colSpan;j.colSpan=1;if(i&&i!=1)for(var f=1;f<i;f++){var g=document.createElement("TD");j.nextSibling?d.insertBefore(g,j.nextSibling):d.appendChild(g);d._childIndexes[b+f]=e+f;g._cellIndex=b+f;g.style.textAlign=this.cellAlign[f];g.style.verticalAlign=this.cellVAlign[f];j=g;this.cells3(d,b+f).setValue("")}for(var h=b*1+1*i;h<d._childIndexes.length;h++)d._childIndexes[h]+=(i-1)*1}if(c&&c>1){if(d._childIndexes)e=d._childIndexes[b];else{e=b;d._childIndexes=[];for(h=0;h<d.childNodes.length;h++)d._childIndexes[h]= 
h}d.childNodes[e].colSpan=c;for(h=1;h<c;h++)d._childIndexes[d.childNodes[e+1]._cellIndex]=e,d.removeChild(d.childNodes[e+1]);for(var l=d.childNodes[d._childIndexes[b]]._cellIndex,h=l*1+1*c;h<d._childIndexes.length;h++)d._childIndexes[h]-=c-1}}},preventIECaching:function(a){this.no_cashe=convertStringToBoolean(a);this.xmlLoader.rSeed=this.no_cashe},enableColumnAutoSize:function(a){this._eCAS=convertStringToBoolean(a)},_onHeaderDblClick:function(a){var b=this.grid,c=b.getFirstParentOfType(_isIE?event.srcElement: 
a.target,"TD");if(!b._eCAS)return!1;b.adjustColumnSize(c._cellIndexS)},adjustColumnSize:function(a,b){if(!this._hrrar||!this._hrrar[a]){this._notresize=!0;var c=0;this._setColumnSizeR(a,20);for(var d=1;d<this.hdr.rows.length;d++){var e=this.hdr.rows[d];if((e=e.childNodes[e._childIndexes?e._childIndexes[a]:a])&&(!e.colSpan||e.colSpan<2)&&e._cellIndex==a)e.childNodes[0]&&e.childNodes[0].className=="hdrcell"&&(e=e.childNodes[0]),c=Math.max(c,e.scrollWidth)}for(var j=this.obj.rows.length,i=1;i<j;i++){var f= 
this.obj.rows[i];this.rowsAr[f.idd]&&!(f._childIndexes&&f._childIndexes[a]!=a)&&f.childNodes[a]&&(f=_isFF||_isOpera||b?f.childNodes[a].textContent.length*this.fontWidth:f.childNodes[a].scrollWidth,f>c&&(c=f))}c+=20+(b||0);this._setColumnSizeR(a,c);this._notresize=!1;this.setSizes()}},detachHeader:function(a,b){var b=b||this.hdr,c=b.rows[a+1];c&&c.parentNode.removeChild(c);this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,b,c){typeof a=="string"&&(a=this._eSplit(a)); 
typeof b=="string"&&(b=b.split(this.delim));c=c||"_aHead";if(this.hdr.rows.length)if(a)this._createHRow([a,b],this[c=="_aHead"?"hdr":"ftr"]);else{if(this[c])for(var d=0;d<this[c].length;d++)this.attachHeader.apply(this,this[c][d])}else this[c]||(this[c]=[]),this[c][this[c].length]=[a,b,c]},_createHRow:function(a,b){if(!b){if(this.entBox.style.position!="absolute")this.entBox.style.position="relative";var c=document.createElement("DIV");c.className="ftr";this.entBox.appendChild(c);var d=document.createElement("TABLE"); 
d.cellPadding=d.cellSpacing=0;if(!_isIE||_isIE==8)d.width="100%",d.style.paddingRight="20px";d.style.marginRight="20px";d.style.tableLayout="fixed";c.appendChild(d);d.appendChild(document.createElement("TBODY"));this.ftr=b=d;for(var e=d.insertRow(0),j=this.hdrLabels.length<=1?a[0].length:this.hdrLabels.length,i=0;i<j;i++)e.appendChild(document.createElement("TH")),e.childNodes[i]._cellIndex=i;_isIE&&_isIE<8?e.style.position="absolute":e.style.height="auto"}var f=a[1],c=document.createElement("TR"); 
b.rows[0].parentNode.appendChild(c);for(i=0;i<a[0].length;i++)if(a[0][i]=="#cspan"){var g=c.cells[c.cells.length-1];g.colSpan=(g.colSpan||1)+1}else if(a[0][i]=="#rspan"&&b.rows.length>1){for(var h=b.rows.length-2,l=!1,g=null;!l;){for(var g=b.rows[h],k=0;k<g.cells.length;k++)if(g.cells[k]._cellIndex==i){l=k+1;break}h--}g=g.cells[l-1];g.rowSpan=(g.rowSpan||1)+1}else{var m=document.createElement("TD");m._cellIndex=m._cellIndexS=i;if(this._hrrar&&this._hrrar[i]&&!_isIE)m.style.display="none";if(typeof a[0][i]== 
"object")m.appendChild(a[0][i]);else if(m.innerHTML=this.forceDivInHeader?"<div class='hdrcell'>"+(a[0][i]||"&nbsp;")+"</div>":a[0][i]||"&nbsp;",(a[0][i]||"").indexOf("#")!=-1)if(d=a[0][i].match(/(^|{)#([^}]+)(}|$)/)){var n="_in_header_"+d[2];if(this[n])this[n](this.forceDivInHeader?m.firstChild:m,i,a[0][i].split(d[0]))}if(f)m.style.cssText=f[i];c.appendChild(m)}var o=b;if(_isKHTML)b._kTimer&&window.clearTimeout(b._kTimer),b._kTimer=window.setTimeout(function(){b.rows[1].style.display="none";window.setTimeout(function(){b.rows[1].style.display= 
""},1)},500)},attachFooter:function(a,b){this.attachHeader(a,b,"_aFoot")},setCellExcellType:function(a,b,c){this.changeCellType(this.getRowById(a),b,c)},changeCellType:function(a,b,c){var c=c||this.cellType[b],d=this.cells3(a,b),e=d.getValue();d.cell._cellType=c;d=this.cells3(a,b);d.setValue(e)},setRowExcellType:function(a,b){for(var c=this.rowsAr[a],d=0;d<c.childNodes.length;d++)this.changeCellType(c,d,b)},setColumnExcellType:function(a,b){for(var c=0;c<this.rowsBuffer.length;c++)this.rowsBuffer[c]&& 
this.rowsBuffer[c].tagName=="TR"&&this.changeCellType(this.rowsBuffer[c],a,b);this.cellType[a]=="math"?this._strangeParams[c]=b:this.cellType[a]=b},forEachRow:function(a){for(var b in this.rowsAr)this.rowsAr[b]&&this.rowsAr[b].idd&&a.apply(this,[this.rowsAr[b].idd])},forEachRowA:function(a){for(var b=0;b<this.rowsBuffer.length;b++)this.rowsBuffer[b]&&a.call(this,this.render_row(b).idd)},forEachCell:function(a,b){var c=this.getRowById(a);if(c)for(var d=0;d<this._cCount;d++)b(this.cells3(c,d),d)},enableAutoWidth:function(a, 
b,c){this._awdth=[convertStringToBoolean(a),parseInt(b||99999),parseInt(c||0)];if(arguments.length==1)this.objBox.style.overflowX=a?"hidden":"auto"},updateFromXML:function(a,b,c,d){typeof b=="undefined"&&(b=!0);this._refresh_mode=[!0,b,c];this.load(a,d)},_refreshFromXML:function(a){this._f_rowsBuffer&&this.filterBy(0,"");reset=!1;if(window.eXcell_tree)eXcell_tree.prototype.setValueX=eXcell_tree.prototype.setValue,eXcell_tree.prototype.setValue=function(a){var b=this.grid._h2.get[this.cell.parentNode.idd]; 
b&&this.cell.parentNode.valTag?this.setLabel(a):this.setValueX(a)};var b=this.cellType._dhx_find("tree");a.getXMLTopNode("rows");var c=a.doXPath("//rows")[0].getAttribute("parent")||0,d={};this._refresh_mode[2]&&(b!=-1?this._h2.forEachChild(c,function(a){d[a.id]=!0},this):this.forEachRow(function(a){d[a]=!0}));for(var e=a.doXPath("//row"),j=0;j<e.length;j++){var i=e[j],f=i.getAttribute("id");d[f]=!1;c=i.parentNode.getAttribute("id")||c;if(this.rowsAr[f]&&this.rowsAr[f].tagName!="TR")this._h2?this._h2.get[f].buff.data= 
i:this.rowsBuffer[this.getRowIndex(f)].data=i,this.rowsAr[f]=i;else if(this.rowsAr[f])this._process_xml_row(this.rowsAr[f],i,-1),this._postRowProcessing(this.rowsAr[f],!0);else if(this._refresh_mode[1]){var g={idd:f,data:i,_parser:this._process_xml_row,_locator:this._get_xml_data},h=this.rowsBuffer.length;this._refresh_mode[1]=="top"?(this.rowsBuffer.unshift(g),h=0):this.rowsBuffer.push(g);if(this._h2)reset=!0,this._h2.add(f,i.parentNode.getAttribute("id")||i.parentNode.getAttribute("parent")).buff= 
this.rowsBuffer[this.rowsBuffer.length-1];this.rowsAr[f]=i;i=this.render_row(h);this._insertRowAt(i,h?-1:0)}}if(this._refresh_mode[2])for(f in d)d[f]&&this.rowsAr[f]&&this.deleteRow(f);this._refresh_mode=null;if(window.eXcell_tree)eXcell_tree.prototype.setValue=eXcell_tree.prototype.setValueX;reset&&this._renderSort();if(this._f_rowsBuffer)this._f_rowsBuffer=null,this.filterByAll()},getCustomCombo:function(a,b){var c=this.cells(a,b).cell;if(!c._combo)c._combo=new dhtmlXGridComboObject;return c._combo}, 
setTabOrder:function(a){var b=a.split(this.delim);this._tabOrder=[];for(var c=this._cCount||a.length,d=0;d<c;d++)b[d]={c:parseInt(b[d]),ind:d};b.sort(function(a,b){return a.c>b.c?1:-1});for(d=0;d<c;d++)this._tabOrder[b[d].ind]=!b[d+1]||typeof b[d].c=="undefined"?(b[0].ind+1)*-1:b[d+1].ind},i18n:{loading:"Loading",decimal_separator:".",group_separator:","},_key_events:{k13_1_0:function(){var a=this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a+1],this.cell._cellIndex,!0)},k13_0_1:function(){var a= 
this.rowsCol._dhx_find(this.row);this.selectCell(this.rowsCol[a-1],this.cell._cellIndex,!0)},k13_0_0:function(){this.editStop();this.callEvent("onEnter",[this.row?this.row.idd:null,this.cell?this.cell._cellIndex:null]);this._still_active=!0},k9_0_0:function(){this.editStop();if(!this.callEvent("onTab",[!0]))return!0;var a=this._getNextCell(null,1);if(a)this.selectCell(a.parentNode,a._cellIndex,this.row!=a.parentNode,!1,!0),this._still_active=!0},k9_0_1:function(){this.editStop();if(!this.callEvent("onTab", 
[!1]))return!1;var a=this._getNextCell(null,-1);if(a)this.selectCell(a.parentNode,a._cellIndex,this.row!=a.parentNode,!1,!0),this._still_active=!0},k113_0_0:function(){this._f2kE&&this.editCell()},k32_0_0:function(){var a=this.cells4(this.cell);if(!a.changeState||a.changeState()===!1)return!1},k27_0_0:function(){this.editStop(!0)},k33_0_0:function(){this.pagingOn?this.changePage(this.currentPage-1):this.scrollPage(-1)},k34_0_0:function(){this.pagingOn?this.changePage(this.currentPage+1):this.scrollPage(1)}, 
k37_0_0:function(){if(!this.editor&&this.isTreeGrid())this.collapseKids(this.row);else return!1},k39_0_0:function(){if(!this.editor&&this.isTreeGrid())this.expandKids(this.row);else return!1},k40_0_0:function(){var a=this._realfake?this._fake:this;if(this.editor&&this.editor.combo)this.editor.shiftNext();else{if(!this.row.idd)return;var b=Math.max(a._r_select||0,this.getRowIndex(this.row.idd)),c=this._nextRow(b,1);if(c)a._r_select=null,this.selectCell(c,this.cell._cellIndex,!0),a.pagingOn&&a.showRow(c.idd); 
else{if(!this.callEvent("onLastRow",[]))return!1;this._key_events.k34_0_0.apply(this,[]);this.pagingOn&&this.rowsCol[b+1]&&this.selectCell(b+1,0,!0)}}this._still_active=!0},k38_0_0:function(){var a=this._realfake?this._fake:this;if(this.editor&&this.editor.combo)this.editor.shiftPrev();else{if(!this.row.idd)return;var b=this.getRowIndex(this.row.idd)+1;if(b!=-1&&(!this.pagingOn||b!=1)){var c=this._nextRow(b-1,-1);this.selectCell(c,this.cell._cellIndex,!0);a.pagingOn&&c&&a.showRow(c.idd)}else this._key_events.k33_0_0.apply(this, 
[])}this._still_active=!0}},_build_master_row:function(){for(var a=document.createElement("DIV"),b=["<table><tr>"],c=0;c<this._cCount;c++)b.push("<td></td>");b.push("</tr></table>");a.innerHTML=b.join("");this._master_row=a.firstChild.rows[0]},_prepareRow:function(a){this._master_row||this._build_master_row();for(var b=this._master_row.cloneNode(!0),c=0;c<b.childNodes.length;c++){b.childNodes[c]._cellIndex=c;if(this._enbCid)b.childNodes[c].id="c_"+a+"_"+c;this.dragAndDropOff&&this.dragger.addDraggableItem(b.childNodes[c], 
this)}b.idd=a;b.grid=this;return b},_process_jsarray_row:function(a,b){a._attrs={};for(var c=0;c<a.childNodes.length;c++)a.childNodes[c]._attrs={};this._fillRow(a,this._c_order?this._swapColumns(b):b);return a},_get_jsarray_data:function(a,b){return a[b]},_process_json_row:function(a,b){b=this._c_order?this._swapColumns(b.data):b.data;return this._process_some_row(a,b)},_process_some_row:function(a,b){a._attrs={};for(var c=0;c<a.childNodes.length;c++)a.childNodes[c]._attrs={};this._fillRow(a,b);return a}, 
_get_json_data:function(a,b){return a.data[b]},_process_js_row:function(a,b){for(var c=[],d=0;d<this.columnIds.length;d++)c[d]=b[this.columnIds[d]],!c[d]&&c[d]!==0&&(c[d]="");this._process_some_row(a,c);a._attrs=b;return a},_get_js_data:function(a,b){return a[this.columnIds[b]]},_process_csv_row:function(a,b){a._attrs={};for(var c=0;c<a.childNodes.length;c++)a.childNodes[c]._attrs={};this._fillRow(a,this._c_order?this._swapColumns(b.split(this.csv.cell)):b.split(this.csv.cell));return a},_get_csv_data:function(a, 
b){return a.split(this.csv.cell)[b]},_process_store_row:function(a,b){for(var c=[],d=0;d<this.columnIds.length;d++)c[d]=b[this.columnIds[d]];for(var e=0;e<a.childNodes.length;e++)a.childNodes[e]._attrs={};a._attrs=b;this._fillRow(a,c)},_process_xml_row:function(a,b){var c=this.xmlLoader.doXPath(this.xml.cell,b),d=[];a._attrs=this._xml_attrs(b);if(this._ud_enabled)for(var e=this.xmlLoader.doXPath("./userdata",b),j=e.length-1;j>=0;j--){for(var i="",f=0;f<e[j].childNodes.length;f++)i+=e[j].childNodes[f].nodeValue; 
this.setUserData(a.idd,e[j].getAttribute("name"),i)}for(f=0;f<c.length;f++){var g=c[this._c_order?this._c_order[f]:f];if(g){var h=a._childIndexes?a._childIndexes[f]:f,l=g.getAttribute("type");if(a.childNodes[h]){if(l)a.childNodes[h]._cellType=l;a.childNodes[h]._attrs=this._xml_attrs(g)}g.getAttribute("xmlcontent")||(g=g.firstChild?g.firstChild.data:"");d.push(g)}}for(;f<a.childNodes.length;f++)a.childNodes[f]._attrs={};a.parentNode&&a.parentNode.tagName=="row"&&(a._attrs.parent=a.parentNode.getAttribute("idd")); 
this._fillRow(a,d);return a},_get_xml_data:function(a,b){for(a=a.firstChild;;){if(!a)return"";a.tagName=="cell"&&b--;if(b<0)break;a=a.nextSibling}return a.firstChild?a.firstChild.data:""},_fillRow:function(a,b){this.editor&&this.editStop();for(var c=0;c<a.childNodes.length;c++)if(c<b.length||this.defVal[c]){var d=a.childNodes[c]._cellIndex,e=b[d],j=this.cells4(a.childNodes[c]);if(this.defVal[d]&&(e==""||typeof e=="undefined"))e=this.defVal[d];j&&j.setValue(e)}else a.childNodes[c].innerHTML="&nbsp;", 
a.childNodes[c]._clearCell=!0;return a},_postRowProcessing:function(a,b){if(a._attrs["class"])a._css=a.className=a._attrs["class"];if(a._attrs.locked)a._locked=!0;if(a._attrs.bgColor)a.bgColor=a._attrs.bgColor;for(var c=0,d=0;d<a.childNodes.length;d++){var e=a.childNodes[d],j=e._cellIndex,i=e._attrs.style||a._attrs.style;i&&(e.style.cssText+=";"+i);if(e._attrs["class"])e.className=e._attrs["class"];if(i=e._attrs.align||this.cellAlign[j])e.align=i;e.vAlign=e._attrs.valign||this.cellVAlign[j];var f= 
e._attrs.bgColor||this.columnColor[j];if(f)e.bgColor=f;e._attrs.colspan&&!b&&(this.setColspan(a.idd,d+c,e._attrs.colspan),c+=e._attrs.colspan-1);if(this._hrrar&&this._hrrar[j]&&!b)e.style.display="none"}this.callEvent("onRowCreated",[a.idd,a,null])},load:function(a,b,c){this.callEvent("onXLS",[this]);arguments.length==2&&typeof b!="function"&&(c=b,b=null);c=c||"xml";if(!this.xmlFileUrl)this.xmlFileUrl=a;this._data_type=c;this.xmlLoader.onloadAction=function(a,e,j,i,f){a.callEvent&&(f=a["_process_"+ 
c](f),a._contextCallTimer||a.callEvent("onXLE",[a,0,0,f]),b&&(b(),b=null))};this.xmlLoader.loadXML(a)},loadXMLString:function(a,b){var c=new dtmlXMLLoaderObject(function(){});c.loadXMLString(a);this.parse(c,b,"xml")},loadXML:function(a,b){this.load(a,b,"xml")},parse:function(a,b,c){arguments.length==2&&typeof b!="function"&&(c=b,b=null);this._data_type=c=c||"xml";a=this["_process_"+c](a);this._contextCallTimer||this.callEvent("onXLE",[this,0,0,a]);b&&b()},xml:{top:"rows",row:"./row",cell:"./cell", 
s_row:"row",s_cell:"cell",row_attrs:[],cell_attrs:[]},csv:{row:"/n",cell:","},_xml_attrs:function(a){var b={};if(a.attributes.length)for(var c=0;c<a.attributes.length;c++)b[a.attributes[c].name]=a.attributes[c].value;return b},_process_xml:function(a){if(!a.doXPath){var b=new dtmlXMLLoaderObject(function(){});typeof a=="string"?b.loadXMLString(a):(b.xmlDoc=a.responseXML?a:{},b.xmlDoc.responseXML=a);a=b}if(this._refresh_mode)return this._refreshFromXML(a);this._parsing=!0;var c=a.getXMLTopNode(this.xml.top); 
if(c.tagName==this.xml.top){var d=c.getAttribute("dhx_security");if(d)dhtmlx.security_key=d;this._parseHead(c);var e=a.doXPath(this.xml.row,c),j=parseInt(a.doXPath("//"+this.xml.top)[0].getAttribute("pos")||0),i=parseInt(a.doXPath("//"+this.xml.top)[0].getAttribute("total_count")||0),i=Math.min(i,32E6/this._srdh),f=!1;i&&i!=this.rowsBuffer.length&&(this.rowsBuffer[i-1]||(this.rowsBuffer.length&&(f=!0),this.rowsBuffer[i-1]=null),i<this.rowsBuffer.length&&(this.rowsBuffer.splice(i,this.rowsBuffer.length- 
i),f=!0));if(this.isTreeGrid())return this._process_tree_xml(a);for(var g=0;g<e.length;g++)if(!this.rowsBuffer[g+j]){var h=e[g].getAttribute("id")||g+j+1;this.rowsBuffer[g+j]={idd:h,data:e[g],_parser:this._process_xml_row,_locator:this._get_xml_data};this.rowsAr[h]=e[g]}this.callEvent("onDataReady",[]);if(f&&this._srnd){var l=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=l}else this.render_dataset();this._parsing=!1;return a.xmlDoc.responseXML?a.xmlDoc.responseXML:a.xmlDoc}},_process_jsarray:function(a){this._parsing= 
!0;if(a&&a.xmlDoc)eval("dhtmlx.temp="+a.xmlDoc.responseText+";"),a=dhtmlx.temp;for(var b=0;b<a.length;b++){var c=b+1;this.rowsBuffer.push({idd:c,data:a[b],_parser:this._process_jsarray_row,_locator:this._get_jsarray_data});this.rowsAr[c]=a[b]}this.render_dataset();this._parsing=!1},_process_csv:function(a){this._parsing=!0;if(a.xmlDoc)a=a.xmlDoc.responseText;a=a.replace(//r/g,"");a=a.split(this.csv.row);if(this._csvHdr){this.clearAll();var b=a.splice(0,1)[0].split(this.csv.cell);this._csvAID||b.splice(0, 
1);this.setHeader(b.join(this.delim));this.init()}for(var c=0;c<a.length;c++)if(a[c]||c!=a.length-1){if(this._csvAID){var d=c+1;this.rowsBuffer.push({idd:d,data:a[c],_parser:this._process_csv_row,_locator:this._get_csv_data})}else{var e=a[c].split(this.csv.cell),d=e.splice(0,1)[0];this.rowsBuffer.push({idd:d,data:e,_parser:this._process_jsarray_row,_locator:this._get_jsarray_data})}this.rowsAr[d]=a[c]}this.render_dataset();this._parsing=!1},_process_js:function(a){return this._process_json(a,"js")}, 
_process_json:function(a,b){this._parsing=!0;if(a&&a.xmlDoc)eval("dhtmlx.temp="+a.xmlDoc.responseText+";"),a=dhtmlx.temp;if(b=="js"){if(a.data)a=a.data;for(var c=0;c<a.length;c++){var d=a[c],e=d.id||c+1;this.rowsBuffer.push({idd:e,data:d,_parser:this._process_js_row,_locator:this._get_js_data});this.rowsAr[e]=a[c]}}else for(c=0;c<a.rows.length;c++)e=a.rows[c].id,this.rowsBuffer.push({idd:e,data:a.rows[c],_parser:this._process_json_row,_locator:this._get_json_data}),this.rowsAr[e]=a.rows[c];if(a.dhx_security)dhtmlx.security_key= 
a.dhx_security;this.render_dataset();this._parsing=!1},render_dataset:function(a,b){if(this._srnd){if(this._fillers)return this._update_srnd_view();b=Math.min(this._get_view_size()+(this._srnd_pr||0),this.rowsBuffer.length)}this.pagingOn?(a=Math.max(a||0,(this.currentPage-1)*this.rowsBufferOutSize),b=Math.min(this.currentPage*this.rowsBufferOutSize,this.rowsBuffer.length)):(a=a||0,b=b||this.rowsBuffer.length);for(var c=a;c<b;c++){var d=this.render_row(c);if(d==-1){if(this.xmlFileUrl&&this.callEvent("onDynXLS", 
[c,this._dpref?this._dpref:b-c]))this.load(this.xmlFileUrl+getUrlSymbol(this.xmlFileUrl)+"posStart="+c+"&count="+(this._dpref?this._dpref:b-c),this._data_type);b=c;break}if(!d.parentNode||!d.parentNode.tagName)if(this._insertRowAt(d,c),d._attrs.selected||d._attrs.select)this.selectRow(d,d._attrs.call?!0:!1,!0),d._attrs.selected=d._attrs.select=null;if(this._ads_count&&c-a==this._ads_count){var e=this;this._context_parsing=this._context_parsing||this._parsing;return this._contextCallTimer=window.setTimeout(function(){e._contextCallTimer= 
null;e.render_dataset(c,b);if(!e._contextCallTimer)e._context_parsing?e.callEvent("onXLE",[]):e._fixAlterCss(),e.callEvent("onDistributedEnd",[]),e._context_parsing=!1},this._ads_time)}}if(this._srnd&&!this._fillers){var j=this.rowsBuffer.length-b;for(this._fillers=[];j>0;){var i=_isIE||window._FFrv?Math.min(j,5E4):j,f=this._add_filler(b,i);f&&this._fillers.push(f);j-=i;b+=i}}this.setSizes()},render_row:function(a){if(!this.rowsBuffer[a])return-1;if(this.rowsBuffer[a]._parser){var b=this.rowsBuffer[a]; 
if(this.rowsAr[b.idd]&&this.rowsAr[b.idd].tagName=="TR")return this.rowsBuffer[a]=this.rowsAr[b.idd];var c=this._prepareRow(b.idd);this.rowsBuffer[a]=c;this.rowsAr[b.idd]=c;b._parser.call(this,c,b.data);this._postRowProcessing(c);return c}return this.rowsBuffer[a]},_get_cell_value:function(a,b,c){return a._locator?(this._c_order&&(b=this._c_order[b]),a._locator.call(this,a.data,b)):this.cells3(a,b)[c?c:"getValue"]()},sortRows:function(a,b,c){c=(c||"asc").toLowerCase();b=b||this.fldSort[a];a=a||0; 
if(this.isTreeGrid())this.sortTreeRows(a,b,c);else{var d={},e=this.cellType[a],j="getValue";e=="link"&&(j="getContent");if(e=="dhxCalendar"||e=="dhxCalendarA")j="getDate";for(var i=0;i<this.rowsBuffer.length;i++)d[this.rowsBuffer[i].idd]=this._get_cell_value(this.rowsBuffer[i],a,j);this._sortRows(a,b,c,d)}this.callEvent("onAfterSorting",[a,b,c])},_sortCore:function(a,b,c,d,e){var j="sort";if(this._sst)e.stablesort=this.rowsCol.stablesort,j="stablesort";b.length>4&&(b=window[b]);if(b=="cus"){var i= 
this._customSorts[a];e[j](function(a,b){return i(d[a.idd],d[b.idd],c,a.idd,b.idd)})}else if(typeof b=="function")e[j](function(a,e){return b(d[a.idd],d[e.idd],c,a.idd,e.idd)});else if(b=="str")e[j](function(a,b){return c=="asc"?d[a.idd]>d[b.idd]?1:d[a.idd]<d[b.idd]?-1:0:d[a.idd]<d[b.idd]?1:d[a.idd]>d[b.idd]?-1:0});else if(b=="int")e[j](function(a,b){var e=parseFloat(d[a.idd]),e=isNaN(e)?-99999999999999:e,i=parseFloat(d[b.idd]),i=isNaN(i)?-99999999999999:i;return c=="asc"?e-i:i-e});else if(b=="date")e[j](function(a, 
b){var e=Date.parse(d[a.idd])||Date.parse("01/01/1900"),i=Date.parse(d[b.idd])||Date.parse("01/01/1900");return c=="asc"?e-i:i-e})},_sortRows:function(a,b,c,d){this._sortCore(a,b,c,d,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(a){if(this.obj.rows[0]){this._lahRw&&this._unsetRowHover(0,!0);this.callEvent("onResetView",[]);var b=this.obj.rows[0].parentNode,c=b.removeChild(b.childNodes[0],!0);if(_isKHTML)for(var d=b.parentNode.childNodes.length- 
1;d>=0;d--)b.parentNode.childNodes[d].tagName=="TR"&&b.parentNode.removeChild(b.parentNode.childNodes[d],!0);else if(_isIE)for(d=b.childNodes.length-1;d>=0;d--)b.childNodes[d].removeNode(!0);else b.innerHTML="";b.appendChild(c);this.rowsCol=dhtmlxArray();this._sst&&this.enableStableSorting(!0);this._fillers=this.undefined;a||this.render_dataset()}},deleteRow:function(a,b){b||(b=this.getRowById(a));if(b){this.editStop();if(!this._realfake&&this.callEvent("onBeforeRowDeleted",[a])==!1)return!1;var c= 
0;if(this.cellType._dhx_find("tree")!=-1&&!this._realfake)c=this._h2.get[a].parent.id,this._removeTrGrRow(b);else{b.parentNode&&b.parentNode.removeChild(b);var d=this.rowsCol._dhx_find(b);d!=-1&&this.rowsCol._dhx_removeAt(d);for(var e=0;e<this.rowsBuffer.length;e++)if(this.rowsBuffer[e]&&this.rowsBuffer[e].idd==a){this.rowsBuffer._dhx_removeAt(e);d=e;break}}this.rowsAr[a]=null;for(e=0;e<this.selectedRows.length;e++)this.selectedRows[e].idd==a&&this.selectedRows._dhx_removeAt(e);if(this._srnd){for(e= 
0;e<this._fillers.length;e++){var j=this._fillers[e];j&&this._update_fillers(e,j[1]>=d?-1:0,j[0]>=d?-1:0)}this._update_srnd_view()}this.pagingOn&&this.changePage();this._realfake||this.callEvent("onAfterRowDeleted",[a,c]);this.callEvent("onGridReconstructed",[]);this._ahgr&&this.setSizes();return!0}},_addRow:function(a,b,c){if(c==-1||typeof c=="undefined")c=this.rowsBuffer.length;typeof b=="string"&&(b=b.split(this.delim));var d=this._prepareRow(a);d._attrs={};for(var e=0;e<d.childNodes.length;e++)d.childNodes[e]._attrs= 
{};this.rowsAr[d.idd]=d;if(this._h2)this._h2.get[d.idd].buff=d;this._fillRow(d,b);this._postRowProcessing(d);if(this._skipInsert)return this._skipInsert=!1,this.rowsAr[d.idd]=d;if(this.pagingOn)return this.rowsBuffer._dhx_insertAt(c,d),this.rowsAr[d.idd]=d;if(this._fillers){this.rowsCol._dhx_insertAt(c,null);this.rowsBuffer._dhx_insertAt(c,d);this._fake&&this._fake.rowsCol._dhx_insertAt(c,null);this.rowsAr[d.idd]=d;for(var j=!1,i=0;i<this._fillers.length;i++){var f=this._fillers[i];if(f&&f[0]<=c&& 
f[0]+f[1]>=c){f[1]+=1;var g=f[2].firstChild.style.height=parseInt(f[2].firstChild.style.height)+this._srdh+"px",j=!0;if(this._fake)this._fake._fillers[i][1]++,this._fake._fillers[i][2].firstChild.style.height=g}f&&f[0]>c&&(f[0]+=1,this._fake&&this._fake._fillers[i][0]++)}j||this._fillers.push(this._add_filler(c,1,c==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:this.rowsCol[1]}:this.rowsCol[c-1]));return d}this.rowsBuffer._dhx_insertAt(c,d);return this._insertRowAt(d,c)},addRow:function(a, 
b,c){var d=this._addRow(a,b,c);this.dragContext||this.callEvent("onRowAdded",[a]);this.pagingOn&&this.changePage(this.currentPage);this._srnd&&this._update_srnd_view();d._added=!0;this._ahgr&&this.setSizes();this.callEvent("onGridReconstructed",[]);return d},_insertRowAt:function(a,b,c){this.rowsAr[a.idd]=a;if(this._skipInsert)return this._skipInsert=!1,a;if(b<0||!b&&parseInt(b)!==0)b=this.rowsCol.length;else if(b>this.rowsCol.length)b=this.rowsCol.length;if(this._cssEven){var d=a.className.replace(this._cssUnEven, 
"");a.className+=(this._cssSP?this.getLevel(a.idd):b)%2==1?d+" "+this._cssUnEven+(this._cssSU?" "+this._cssUnEven+"_"+this.getLevel(a.idd):""):d+" "+this._cssEven+(this._cssSU?" "+this._cssEven+"_"+this.getLevel(a.idd):"")}c||(b==this.obj.rows.length-1||!this.rowsCol[b]?_isKHTML?this.obj.appendChild(a):this.obj.firstChild.appendChild(a):this.rowsCol[b].parentNode.insertBefore(a,this.rowsCol[b]));this.rowsCol._dhx_insertAt(b,a);this.callEvent("onRowInserted",[a,b]);return a},getRowById:function(a){var b= 
this.rowsAr[a];if(b){if(b.tagName!="TR"){for(var c=0;c<this.rowsBuffer.length;c++)if(this.rowsBuffer[c]&&this.rowsBuffer[c].idd==a)return this.render_row(c);if(this._h2)return this.render_row(null,b.idd)}return b}return null},cellById:function(a,b){return this.cells(a,b)},cells:function(a,b){if(arguments.length==0)return this.cells4(this.cell);else var c=this.getRowById(a);var d=c._childIndexes?c.childNodes[c._childIndexes[b]]:c.childNodes[b];!d&&c._childIndexes&&(d=c.firstChild||{});return this.cells4(d)}, 
cellByIndex:function(a,b){return this.cells2(a,b)},cells2:function(a,b){var c=this.render_row(a),d=c._childIndexes?c.childNodes[c._childIndexes[b]]:c.childNodes[b];!d&&c._childIndexes&&(d=c.firstChild||{});return this.cells4(d)},cells3:function(a,b){var c=a._childIndexes?a.childNodes[a._childIndexes[b]]:a.childNodes[b];return this.cells4(c)},cells4:function(a){var b=window["eXcell_"+(a._cellType||this.cellType[a._cellIndex])];if(b)return new b(a)},cells5:function(a,b){b=b||a._cellType||this.cellType[a._cellIndex]; 
if(!this._ecache[b]){var c=window["eXcell_"+b]?window["eXcell_"+b]:eXcell_ro;this._ecache[b]=new c(a)}this._ecache[b].cell=a;return this._ecache[b]},dma:function(a){if(!this._ecache)this._ecache={};if(a&&!this._dma)this._dma=this.cells4,this.cells4=this.cells5;else if(!a&&this._dma)this.cells4=this._dma,this._dma=null},getRowsNum:function(){return this.rowsBuffer.length},enableEditTabOnly:function(a){this.smartTabOrder=arguments.length>0?convertStringToBoolean(a):!0},setExternalTabOrder:function(a, 
b){var c=this;this.tabStart=typeof a=="object"?a:document.getElementById(a);var d=this.tabStart.onkeydown;this.tabStart.onkeydown=function(a){d&&d.call(this,a);var b=a||window.event;if(b.keyCode==9&&!b.shiftKey)return b.cancelBubble=!0,c.selectCell(0,0,0,0,1),c.smartTabOrder&&c.cells2(0,0).isDisabled()&&c._key_events.k9_0_0.call(c),this.blur(),!1};if(_isOpera)this.tabStart.onkeypress=this.tabStart.onkeydown;this.tabEnd=typeof b=="object"?b:document.getElementById(b);var e=this.tabEnd.onkeydown;this.tabEnd.onkeydown= 
this.tabEnd.onkeypress=function(a){e&&e.call(this,a);var b=a||window.event;if(b.keyCode==9&&b.shiftKey)return b.cancelBubble=!0,c.selectCell(c.getRowsNum()-1,c.getColumnCount()-1,0,0,1),c.smartTabOrder&&c.cells2(c.getRowsNum()-1,c.getColumnCount()-1).isDisabled()&&c._key_events.k9_0_1.call(c),this.blur(),!1};if(_isOpera)this.tabEnd.onkeypress=this.tabEnd.onkeydown},uid:function(){if(!this._ui_seed)this._ui_seed=(new Date).valueOf();return this._ui_seed++},clearAndLoad:function(){var a=this._pgn_skin; 
this._pgn_skin=null;this.clearAll();this._pgn_skin=a;this.load.apply(this,arguments)},getStateOfView:function(){if(this.pagingOn){var a=(this.currentPage-1)*this.rowsBufferOutSize;return[this.currentPage,a,Math.min(a+this.rowsBufferOutSize,this.rowsBuffer.length),this.rowsBuffer.length]}return[Math.floor(this.objBox.scrollTop/this._srdh),Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),this.rowsBuffer.length]}}; 
(function(){function a(a,b){this[a]=b}function b(a,b){this[a].call(this,b)}function c(a,b){this[a].call(this,b.join(this.delim))}function d(a,b){for(var c=0;c<b.length;c++)if(typeof b[c]=="object"){var d=this.getCombo(c),e;for(e in b[c])d.put(e,b[c][e])}}function e(a,b){function c(a,b,d){e[b]||(e[b]=[]);if(typeof d=="object")d.toString=function(){return this.text};e[b][a]=d}for(var d=1,e=[],k=0;k<b.length;k++)if(typeof b[k]=="object"&&b[k].length)for(var j=0;j<b[k].length;j++)c(k,j,b[k][j]);else c(k, 
0,b[k]);for(k=0;k<e.length;k++)for(j=0;j<e[0].length;j++){var n=e[k][j];e[k][j]=(n||"").toString()||"&nbsp;";if(n&&n.colspan)for(var o=1;o<n.colspan;o++)c(j+o,k,"#cspan");if(n&&n.rowspan)for(o=1;o<n.rowspan;o++)c(j,k+o,"#rspan")}this.setHeader(e[0]);for(k=1;k<e.length;k++)this.attachHeader(e[k])}var j=[{name:"label",def:"&nbsp;",operation:"setHeader",type:e},{name:"id",def:"",operation:"columnIds",type:a},{name:"width",def:"*",operation:"setInitWidths",type:c},{name:"align",def:"left",operation:"cellAlign", 
type:a},{name:"valign",def:"middle",operation:"cellVAlign",type:a},{name:"sort",def:"na",operation:"fldSort",type:a},{name:"type",def:"ro",operation:"setColTypes",type:c},{name:"options",def:"",operation:"",type:d}];dhtmlx.extend_api("dhtmlXGridObject",{_init:function(a){return[a.parent]},image_path:"setImagePath",columns:"columns",rows:"rows",headers:"headers",skin:"setSkin",smart_rendering:"enableSmartRendering",css:"enableAlterCss",auto_height:"enableAutoHeight",save_hidden:"enableAutoHiddenColumnsSaving", 
save_cookie:"enableAutoSaving",save_size:"enableAutoSizeSaving",auto_width:"enableAutoWidth",block_selection:"enableBlockSelection",csv_id:"enableCSVAutoID",csv_header:"enableCSVHeader",cell_ids:"enableCellIds",colspan:"enableColSpan",column_move:"enableColumnMove",context_menu:"enableContextMenu",distributed:"enableDistributedParsing",drag:"enableDragAndDrop",drag_order:"enableDragOrder",tabulation:"enableEditTabOnly",header_images:"enableHeaderImages",header_menu:"enableHeaderMenu",keymap:"enableKeyboardSupport", 
mouse_navigation:"enableLightMouseNavigation",markers:"enableMarkedCells",math_editing:"enableMathEditing",math_serialization:"enableMathSerialization",drag_copy:"enableMercyDrag",multiline:"enableMultiline",multiselect:"enableMultiselect",save_column_order:"enableOrderSaving",hover:"enableRowsHover",rowspan:"enableRowspan",smart:"enableSmartRendering",save_sorting:"enableSortingSaving",stable_sorting:"enableStableSorting",undo:"enableUndoRedo",csv_cell:"setCSVDelimiter",date_format:"setDateFormat", 
drag_behavior:"setDragBehavior",editable:"setEditable",without_header:"setNoHeader",submit_changed:"submitOnlyChanged",submit_serialization:"submitSerialization",submit_selected:"submitOnlySelected",submit_id:"submitOnlyRowID",xml:"load"},{columns:function(a){for(var c=0;c<j.length;c++){for(var d=[],e=0;e<a.length;e++)d[e]=a[e][j[c].name]||j[c].def;var l=j[c].type||b;l.call(this,j[c].operation,d,a)}this.init()},rows:function(){},headers:function(a){for(var b=0;b<a.length;b++)this.attachHeader(a[b])}})})(); 
dhtmlXGridObject.prototype._dp_init=function(a){a.attachEvent("insertCallback",function(a,c){this.obj._h2?this.obj.addRow(c,d,null,parent):this.obj.addRow(c,[],0);var d=this.obj.getRowById(c);d&&(this.obj._process_xml_row(d,a.firstChild),this.obj._postRowProcessing(d))});a.attachEvent("updateCallback",function(a,c){var d=this.obj.getRowById(c);d&&(this.obj._process_xml_row(d,a.firstChild),this.obj._postRowProcessing(d))});a.attachEvent("deleteCallback",function(a,c){this.obj.setUserData(c,this.action_param, 
"true_deleted");this.obj.deleteRow(c)});a._methods=["setRowTextStyle","setCellTextStyle","changeRowId","deleteRow"];this.attachEvent("onEditCell",function(b,c,d){if(a._columns&&!a._columns[d])return!0;var e=this.cells(c,d);b==1?e.isCheckbox()&&a.setUpdated(c,!0):b==2&&e.wasChanged()&&a.setUpdated(c,!0);return!0});this.attachEvent("onRowPaste",function(b){a.setUpdated(b,!0)});this.attachEvent("onUndo",function(b){a.setUpdated(b,!0)});this.attachEvent("onRowIdChange",function(b,c){var d=a.findRow(b); 
d<a.updatedRows.length&&(a.updatedRows[d]=c)});this.attachEvent("onSelectStateChanged",function(){a.updateMode=="row"&&a.sendData();return!0});this.attachEvent("onEnter",function(){a.updateMode=="row"&&a.sendData();return!0});this.attachEvent("onBeforeRowDeleted",function(b){if(!this.rowsAr[b])return!0;if(this.dragContext&&a.dnd)return window.setTimeout(function(){a.setUpdated(b,!0)},1),!0;var c=a.getState(b);this._h2&&this._h2.forEachChild(b,function(b){a.setUpdated(b.id,!1);a.markRow(b.id,!0,"deleted")}, 
this);if(c=="inserted")return a.set_invalid(b,!1),a.setUpdated(b,!1),!0;if(c=="deleted")return!1;if(c=="true_deleted")return a.setUpdated(b,!1),!0;a.setUpdated(b,!0,"deleted");return!1});this.attachEvent("onBindUpdate",function(b){if(typeof b=="object")b=b.id;a.setUpdated(b,!0)});this.attachEvent("onRowAdded",function(b){if(this.dragContext&&a.dnd)return!0;a.setUpdated(b,!0,"inserted");return!0});a._getRowData=function(a){var c=[];c.gr_id=a;this.obj.isTreeGrid()&&(c.gr_pid=this.obj.getParentId(a)); 
for(var d=this.obj.getRowById(a),e=0;e<this.obj._cCount;e++){var j=this.obj._c_order?this.obj._c_order[e]:e,i=this.obj.cells(d.idd,e);if(!this._changed||i.wasChanged())this._endnm?c[this.obj.getColumnId(e)]=i.getValue():c["c"+j]=i.getValue()}var f=this.obj.UserData[a];if(f)for(var g=0;g<f.keys.length;g++)f.keys[g]&&f.keys[g].indexOf("__")!=0&&(c[f.keys[g]]=f.values[g]);if(f=this.obj.UserData.gridglobaluserdata)for(g=0;g<f.keys.length;g++)c[f.keys[g]]=f.values[g];return c};a._clearUpdateFlag=function(a){var c= 
this.obj.getRowById(a);if(c)for(var d=0;d<this.obj._cCount;d++)this.obj.cells(a,d).cell.wasChanged=!1};a.checkBeforeUpdate=function(a){for(var c=!0,d=[],e=0;e<this.obj._cCount;e++)if(this.mandatoryFields[e]){var j=this.mandatoryFields[e].call(this.obj,this.obj.cells(a,e).getValue(),a,e);typeof j=="string"?(this.messages.push(j),c=!1):(c&=j,d[e]=!j)}c||(this.set_invalid(a,"invalid",d),this.setUpdated(a,!1));return c}}; 
//v.3.6 build 130619 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/

dhtmlxgridcell.js

//v.3.6 build 130619 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/ 
function dhtmlXGridCellObject(a){this.destructor=function(){return this.base=this.grid=this.cell=this.cell.obj=null};this.cell=a;this.getValue=function(){return this.cell.firstChild&&this.cell.firstChild.tagName=="TEXTAREA"?this.cell.firstChild.value:this.cell.innerHTML._dhx_trim()};this.getMathValue=function(){return this.cell.original?this.cell.original:this.getValue()};this.getFont=function(){arOut=Array(3);if(this.cell.style.fontFamily)arOut[0]=this.cell.style.fontFamily;if(this.cell.style.fontWeight== 
"bold"||this.cell.parentNode.style.fontWeight=="bold")arOut[1]="bold";if(this.cell.style.fontStyle=="italic"||this.cell.parentNode.style.fontWeight=="italic")arOut[1]+="italic";arOut[2]=this.cell.style.fontSize?this.cell.style.fontSize:"";return arOut.join("-")};this.getTextColor=function(){return this.cell.style.color?this.cell.style.color:"#000000"};this.getBgColor=function(){return this.cell.bgColor?this.cell.bgColor:"#FFFFFF"};this.getHorAlign=function(){return this.cell.style.textAlign?this.cell.style.textAlign: 
this.cell.style.textAlign?this.cell.style.textAlign:"left"};this.getWidth=function(){return this.cell.scrollWidth};this.setFont=function(a){fntAr=a.split("-");this.cell.style.fontFamily=fntAr[0];this.cell.style.fontSize=fntAr[fntAr.length-1];if(fntAr.length==3){if(/bold/.test(fntAr[1]))this.cell.style.fontWeight="bold";if(/italic/.test(fntAr[1]))this.cell.style.fontStyle="italic";if(/underline/.test(fntAr[1]))this.cell.style.textDecoration="underline"}};this.setTextColor=function(a){this.cell.style.color= 
a};this.setBgColor=function(a){a==""&&(a=null);this.cell.bgColor=a};this.setHorAlign=function(a){this.cell.style.textAlign=a.length==1?a=="c"?"center":a=="l"?"left":"right":a};this.wasChanged=function(){return this.cell.wasChanged?!0:!1};this.isCheckbox=function(){var a=this.cell.firstChild;return a&&a.tagName=="INPUT"?(type=a.type,type=="radio"||type=="checkbox"?!0:!1):!1};this.isChecked=function(){if(this.isCheckbox())return this.cell.firstChild.checked};this.isDisabled=function(){return this.cell._disabled}; 
this.setChecked=function(a){if(this.isCheckbox())a!="true"&&a!=1&&(a=!1),this.cell.firstChild.checked=a};this.setDisabled=function(a){a!="true"&&a!=1&&(a=!1);if(this.isCheckbox())this.cell.firstChild.disabled=a,this.disabledF&&this.disabledF(a);this.cell._disabled=a}} 
dhtmlXGridCellObject.prototype={getAttribute:function(a){return this.cell._attrs[a]},setAttribute:function(a,b){this.cell._attrs[a]=b},getInput:function(){if(this.obj&&(this.obj.tagName=="INPUT"||this.obj.tagName=="TEXTAREA"))return this.obj;var a=(this.obj||this.cell).getElementsByTagName("TEXTAREA");a.length||(a=(this.obj||this.cell).getElementsByTagName("INPUT"));return a[0]}}; 
dhtmlXGridCellObject.prototype.setValue=function(a){typeof a!="number"&&(!a||a.toString()._dhx_trim()=="")?(a="&nbsp;",this.cell._clearCell=!0):this.cell._clearCell=!1;this.setCValue(a)};dhtmlXGridCellObject.prototype.getTitle=function(){return _isIE?this.cell.innerText:this.cell.textContent};dhtmlXGridCellObject.prototype.setCValue=function(a,b){this.cell.innerHTML=a;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,arguments.length>1?b:a])}; 
dhtmlXGridCellObject.prototype.setCTxtValue=function(a){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(a));this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,a])};dhtmlXGridCellObject.prototype.setLabel=function(a){this.cell.innerHTML=a};dhtmlXGridCellObject.prototype.getMath=function(){return this._val?this.val:this.getValue()}; 
function eXcell(){this.val=this.obj=null;this.changeState=function(){return!1};this.edit=function(){this.val=this.getValue()};this.detach=function(){return!1};this.getPosition=function(a){for(var b=a,c=0,d=0;b.tagName!="BODY";)c+=b.offsetLeft,d+=b.offsetTop,b=b.offsetParent;return[c,d]}}eXcell.prototype=new dhtmlXGridCellObject; 
function eXcell_ed(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.edit=function(){this.cell.atag=!this.grid.multiLine&&(_isKHTML||_isMacOS||_isFF)?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=this.cell.offsetHeight-(_isIE?4:4)+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(a){(a||event).cancelBubble= 
!0};this.obj.onmousedown=function(a){(a||event).cancelBubble=!0};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(a){a||(a=event);return a.cancelBubble=!0};_isIE&&(this.obj.focus(),this.obj.blur());this.obj.focus()};this.getValue=function(){return this.cell.firstChild&&this.cell.atag&&this.cell.firstChild.tagName==this.cell.atag?this.cell.firstChild.value:this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()};this.detach=function(){this.setValue(this.obj.value); 
return this.val!=this.getValue()}}eXcell_ed.prototype=new eXcell;function eXcell_edtxt(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.getValue=function(){return this.cell.firstChild&&this.cell.atag&&this.cell.firstChild.tagName==this.cell.atag?this.cell.firstChild.value:this.cell._clearCell?"":_isIE?this.cell.innerText:this.cell.textContent};this.setValue=function(a){!a||a.toString()._dhx_trim()==""?(a=" ",this.cell._clearCell=!0):this.cell._clearCell=!1;this.setCTxtValue(a)}} 
eXcell_edtxt.prototype=new eXcell_ed;function eXcell_edn(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.getValue=function(){return this.cell.firstChild&&this.cell.firstChild.tagName=="TEXTAREA"?this.cell.firstChild.value:this.cell._clearCell?"":this.cell._orig_value||this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)};this.detach=function(){var a=this.obj.value;this.setValue(a);return this.val!=this.getValue()}}eXcell_edn.prototype=new eXcell_ed; 
eXcell_edn.prototype.setValue=function(a){if(!a||a.toString()._dhx_trim()=="")return this.cell._clearCell=!0,this.setCValue("&nbsp;",0);else this.cell._clearCell=!1,this.cell._orig_value=a;this.setCValue(this.grid._aplNF(a,this.cell._cellIndex),a)}; 
function eXcell_ch(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.disabledF=function(a){this.cell.innerHTML=a==!0||a==1?this.cell.innerHTML.replace("item_chk0.","item_chk0_dis.").replace("item_chk1.","item_chk1_dis."):this.cell.innerHTML.replace("item_chk0_dis.","item_chk0.").replace("item_chk1_dis.","item_chk1.")};this.changeState=function(a){a===!0&&!this.grid.isActive&&(window.globalActiveDHTMLGridObject!=null&&window.globalActiveDHTMLGridObject!=this.grid&&window.globalActiveDHTMLGridObject.isActive&& 
window.globalActiveDHTMLGridObject.setActive(!1),this.grid.setActive(!0));if(this.grid.isEditable&&!this.cell.parentNode._locked&&!this.isDisabled())this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])?(this.val=this.getValue(),this.val=="1"?this.setValue("0"):this.setValue("1"),this.cell.wasChanged=!0,this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]),this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!= 
"1"]),this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!="1"])):this.editor=null};this.getValue=function(){return this.cell.chstate?this.cell.chstate.toString():"0"};this.isCheckbox=function(){return!0};this.isChecked=function(){return this.getValue()=="1"?!0:!1};this.setChecked=function(a){this.setValue(a.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell; 
eXcell_ch.prototype.setValue=function(a){this.cell.style.verticalAlign="middle";if(a&&(a=a.toString()._dhx_trim(),a=="false"||a=="0"))a="";a?(a="1",this.cell.chstate="1"):(a="0",this.cell.chstate="0");var b=this;this.setCValue("<img src='"+this.grid.imgURL+"item_chk"+a+".gif' onclick='new eXcell_ch(this.parentNode).changeState(true); (arguments[0]||event).cancelBubble=true; '>",this.cell.chstate)}; 
function eXcell_ra(a){this.base=eXcell_ch;this.base(a);this.grid=a.parentNode.grid;this.disabledF=function(a){this.cell.innerHTML=a==!0||a==1?this.cell.innerHTML.replace("radio_chk0.","radio_chk0_dis.").replace("radio_chk1.","radio_chk1_dis."):this.cell.innerHTML.replace("radio_chk0_dis.","radio_chk0.").replace("radio_chk1_dis.","radio_chk1.")};this.changeState=function(a){if(!(a===!1&&this.getValue()==1)&&this.grid.isEditable&&!this.cell.parentNode._locked)this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd, 
this.cell._cellIndex])!=!1?(this.val=this.getValue(),this.val=="1"?this.setValue("0"):this.setValue("1"),this.cell.wasChanged=!0,this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]),this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!="1"]),this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,this.val!="1"])):this.editor=null};this.edit=null}eXcell_ra.prototype=new eXcell_ch; 
eXcell_ra.prototype.setValue=function(a){this.cell.style.verticalAlign="middle";if(a&&(a=a.toString()._dhx_trim(),a=="false"||a=="0"))a="";if(a){if(!this.grid._RaSeCol)this.grid._RaSeCol=[];if(this.grid._RaSeCol[this.cell._cellIndex]){var b=this.grid.cells4(this.grid._RaSeCol[this.cell._cellIndex]);b.setValue("0");this.grid.rowsAr[b.cell.parentNode.idd]&&this.grid.callEvent("onEditCell",[1,b.cell.parentNode.idd,b.cell._cellIndex])}this.grid._RaSeCol[this.cell._cellIndex]=this.cell;a="1";this.cell.chstate= 
"1"}else a="0",this.cell.chstate="0";this.setCValue("<img src='"+this.grid.imgURL+"radio_chk"+a+".gif' onclick='new eXcell_ra(this.parentNode).changeState(false);'>",this.cell.chstate)}; 
function eXcell_txt(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.edit=function(){this.val=this.getValue();this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_textarea";this.obj.onclick=function(a){(a||event).cancelBubble=!0};var a=this.grid.getPosition(this.cell);this.obj.value=this.val;this.obj.style.display="";this.obj.style.textAlign=this.cell.style.textAlign;if(_isFF){var c=document.createElement("DIV");c.appendChild(this.obj);c.style.overflow="auto";c.className= 
"dhx_textarea";this.obj.style.margin="0px 0px 0px 0px";this.obj.style.border="0px";this.obj=c}document.body.appendChild(this.obj);if(_isOpera)this.obj.onkeypress=function(a){if(a.keyCode==9)return!1};this.obj.onkeydown=function(a){var b=a||event;if(b.keyCode==9)return globalActiveDHTMLGridObject.entBox.focus(),globalActiveDHTMLGridObject.doKey({keyCode:b.keyCode,shiftKey:b.shiftKey,srcElement:"0"}),!1};this.obj.style.left=a[0]+"px";this.obj.style.top=a[1]+this.cell.offsetHeight+"px";var d=this.cell.offsetWidth< 
200?200:this.cell.offsetWidth;this.obj.style.width=d+(_isFF?18:16)+"px";if(_isFF)this.obj.firstChild.style.width=parseInt(this.obj.style.width)+"px",this.obj.firstChild.style.height=this.obj.offsetHeight-3+"px";if(_isIE)this.obj.select(),this.obj.value=this.obj.value;_isFF?this.obj.firstChild.focus():this.obj.focus()};this.detach=function(){var a="",a=_isFF?this.obj.firstChild.value:this.obj.value;this.cell._clearCell=a==""?!0:!1;this.setValue(a);document.body.removeChild(this.obj);this.obj=null; 
return this.val!=this.getValue()};this.getValue=function(){return this.obj?_isFF?this.obj.firstChild.value:this.obj.value:this.cell._clearCell?"":typeof this.cell._brval!="undefined"?this.cell._brval:this.grid.multiLine?this.cell._brval||this.cell.innerHTML.replace(/<br[^>]*>/gi,"/n")._dhx_trim():this.cell._brval||this.cell.innerHTML}}eXcell_txt.prototype=new eXcell; 
function eXcell_txttxt(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.getValue=function(){return this.cell.firstChild&&this.cell.firstChild.tagName=="TEXTAREA"?this.cell.firstChild.value:this.cell._clearCell?"":!this.grid.multiLine&&this.cell._brval?this.cell._brval:_isIE?this.cell.innerText:this.cell.textContent};this.setValue=function(a){this.cell._brval=a;!a||a.toString()._dhx_trim()==""?(a=" ",this.cell._clearCell=!0):this.cell._clearCell=!1;this.setCTxtValue(a)}} 
eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(a){this.cell._brval=a;!a||a.toString()._dhx_trim()==""?(a="&nbsp;",this.cell._clearCell=!0):this.cell._clearCell=!1;!this.grid.multiLine||this.cell._clearCell?this.setCValue(a,this.cell._brval):this.setCValue(a.replace(//n/g,"<br/>"),a)}; 
function eXcell_co(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid,this.combo=this.cell._combo||this.grid.getCombo(this.cell._cellIndex),this.editable=!0;this.shiftNext=function(){var a=this.list.options[this.list.selectedIndex+1];if(a)a.selected=!0;this.obj.value=this.list.options[this.list.selectedIndex].text;return!0};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var a=this.list.options[this.list.selectedIndex-1];if(a)a.selected=!0;this.obj.value=this.list.options[this.list.selectedIndex].text}return!0}; 
this.edit=function(){this.val=this.getValue();this.text=this.getText()._dhx_trim();var a=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=this.cell.offsetHeight-4+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(a){(a||event).cancelBubble=!0};this.obj.onmousedown=function(a){(a||event).cancelBubble=!0};this.obj.value=this.text;this.obj.onselectstart=function(a){a|| 
(a=event);return a.cancelBubble=!0};var c=this;this.obj.onkeyup=function(a){var b=(a||event).keyCode;if(!(b==38||b==40||b==9))for(var d=this.readonly?String.fromCharCode(b):this.value,f=c.list.options,e=0;e<f.length;e++)if(f[e].text.indexOf(d)==0)return f[e].selected=!0};this.list=document.createElement("SELECT");this.list.className="dhx_combo_select";this.list.style.width=this.cell.offsetWidth+"px";this.list.style.left=a[0]+"px";this.list.style.top=a[1]+this.cell.offsetHeight+"px";this.list.onclick= 
function(a){var b=a||window.event,d=b.target||b.srcElement;if(d.tagName=="OPTION")d=d.parentNode;c.editable=!1;c.grid.editStop();b.cancelBubble=!0};for(var d=this.combo.getKeys(),g=!1,e=0,f=0;f<d.length;f++){var l=this.combo.get(d[f]);this.list.options[this.list.options.length]=new Option(l,d[f]);d[f]==this.val&&(e=this.list.options.length-1,g=!0)}g==!1&&(this.list.options[this.list.options.length]=new Option(this.text,this.val===null?"":this.val),e=this.list.options.length-1);document.body.appendChild(this.list); 
this.list.size="6";this.cstate=1;this.editable?this.cell.innerHTML="":(this.obj.style.width="1px",this.obj.style.height="1px");this.cell.appendChild(this.obj);this.list.options[e].selected=!0;if(!_isFF||this.editable)this.obj.focus(),this.obj.focus();if(!this.editable)this.obj.style.visibility="hidden",this.list.focus(),this.list.onkeydown=function(a){a=a||window.event;c.grid.setActive(!0);if(a.keyCode<30)return c.grid.doKey({target:c.cell,keyCode:a.keyCode,shiftKey:a.shiftKey,ctrlKey:a.ctrlKey})}}; 
this.getValue=function(){return this.cell.combo_value==window.undefined?"":this.cell.combo_value};this.detach=function(){if(this.val!=this.getValue())this.cell.wasChanged=!0;if(this.list.parentNode!=null)if(this.editable){var a=this.list.options[this.list.selectedIndex];if(a&&a.text==this.obj.value)this.setValue(this.list.value);else{var c=this.cell._combo||this.grid.getCombo(this.cell._cellIndex),d=c.values._dhx_find(this.obj.value);d!=-1?this.setValue(c.keys[d]):this.setCValue(this.cell.combo_value= 
this.obj.value)}}else this.setValue(this.list.value);this.list.parentNode&&this.list.parentNode.removeChild(this.list);this.obj.parentNode&&this.obj.parentNode.removeChild(this.obj);return this.val!=this.getValue()}}eXcell_co.prototype=new eXcell;eXcell_co.prototype.getText=function(){return this.cell.innerHTML}; 
eXcell_co.prototype.setValue=function(a){if(typeof a=="object"){var b=this.grid.xmlLoader.doXPath("./option",a);if(b.length)this.cell._combo=new dhtmlXGridComboObject;for(var c=0;c<b.length;c++)this.cell._combo.put(b[c].getAttribute("value"),b[c].firstChild?b[c].firstChild.data:"");a=a.firstChild.data}if((a||"").toString()._dhx_trim()=="")a=null;this.cell.combo_value=a;if(a!==null){var d=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(a);this.setCValue(d===null?a:d,a)}else this.setCValue("&nbsp;", 
a)};function eXcell_coro(a){this.base=eXcell_co;this.base(a);this.editable=!1}eXcell_coro.prototype=new eXcell_co;function eXcell_cotxt(a){this.base=eXcell_co;this.base(a)}eXcell_cotxt.prototype=new eXcell_co;eXcell_cotxt.prototype.getText=function(){return _isIE?this.cell.innerText:this.cell.textContent}; 
eXcell_cotxt.prototype.setValue=function(a){if(typeof a=="object"){var b=this.grid.xmlLoader.doXPath("./option",a);if(b.length)this.cell._combo=new dhtmlXGridComboObject;for(var c=0;c<b.length;c++)this.cell._combo.put(b[c].getAttribute("value"),b[c].firstChild?b[c].firstChild.data:"");a=a.firstChild.data}if((a||"").toString()._dhx_trim()=="")a=null;a!==null?this.setCTxtValue((this.cell._combo||this.grid.getCombo(this.cell._cellIndex)).get(a)||a,a):this.setCTxtValue(" ",a);this.cell.combo_value=a}; 
function eXcell_corotxt(a){this.base=eXcell_co;this.base(a);this.editable=!1}eXcell_corotxt.prototype=new eXcell_cotxt; 
function eXcell_cp(a){try{this.cell=a,this.grid=this.cell.parentNode.grid}catch(b){}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("SPAN");this.obj.style.border="1px solid black";this.obj.style.position="absolute";var a=this.grid.getPosition(this.cell);this.colorPanel(4,this.obj);document.body.appendChild(this.obj);this.obj.style.left=a[0]+"px";this.obj.style.zIndex=1E3;this.obj.style.top=a[1]+this.cell.offsetHeight+"px"};this.toolDNum=function(a){a.length==1&&(a="0"+ 
a);return a};this.colorPanel=function(a,b){var g=document.createElement("TABLE");b.appendChild(g);g.cellSpacing=0;g.editor_obj=this;g.style.cursor="default";g.onclick=function(a){var b=a||window.event,c=b.target||b.srcElement,d=c.parentNode.parentNode.parentNode.editor_obj;d.setValue(c._bg);d.grid.editStop()};for(var e=256/a,f=0;f<=256/e;f++)for(var l=g.insertRow(f),i=0;i<=256/e;i++)for(var j=0;j<=256/e;j++){R=new Number(e*f)-(f==0?0:1);G=new Number(e*i)-(i==0?0:1);B=new Number(e*j)-(j==0?0:1);var k= 
this.toolDNum(R.toString(16))+""+this.toolDNum(G.toString(16))+""+this.toolDNum(B.toString(16)),h=l.insertCell(i);h.width="10px";h.innerHTML="&nbsp;";h.title=k.toUpperCase();h.style.backgroundColor="#"+k;h._bg="#"+k;if(this.val!=null&&"#"+k.toUpperCase()==this.val.toUpperCase())h.style.border="2px solid white"}};this.getValue=function(){return this.cell.firstChild._bg||""};this.getRed=function(){return Number(parseInt(this.getValue().substr(1,2),16))};this.getGreen=function(){return Number(parseInt(this.getValue().substr(3, 
2),16))};this.getBlue=function(){return Number(parseInt(this.getValue().substr(5,2),16))};this.detach=function(){this.obj.offsetParent!=null&&document.body.removeChild(this.obj);return this.val!=this.getValue()}}eXcell_cp.prototype=new eXcell;eXcell_cp.prototype.setValue=function(a){this.setCValue("<div style='width:100%;height:"+(this.grid.multiLine?this.cell.offsetHeight-2:16)+";background-color:"+(a||"")+";border:0px;'>&nbsp;</div>",a);this.cell.firstChild._bg=a}; 
function eXcell_img(a){try{this.cell=a,this.grid=this.cell.parentNode.grid}catch(b){}this.getValue=function(){if(this.cell.firstChild.tagName=="IMG")return this.cell.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");else if(this.cell.firstChild.tagName=="A"){var a=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");a+="^"+this.cell.lnk;this.cell.trg&&(a+="^"+this.cell.trg);return a}};this.isDisabled=function(){return!0}}eXcell_img.prototype=new eXcell; 
eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(a){var b=a;if(a.indexOf("^")!=-1){var c=a.split("^"),a=c[0],b=this.cell._attrs.title||c[1];if(c.length>2&&(this.cell.lnk=c[2],c[3]))this.cell.trg=c[3];this.cell.titFl="1"}this.setCValue("<img src='"+this.grid.iconURL+(a||"")._dhx_trim()+"' border='0'>",a);if(this.cell.lnk)this.cell.innerHTML="<a href='"+this.cell.lnk+"' target='"+this.cell.trg+"'>"+this.cell.innerHTML+"</a>";this.cell._brval=b}; 
function eXcell_price(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.childNodes.length>1?this.cell.childNodes[1].innerHTML.toString()._dhx_trim():"0"}}eXcell_price.prototype=new eXcell_ed;eXcell_price.prototype.setValue=function(a){isNaN(parseFloat(a))&&(a=this.val||0);var b="green";a<0&&(b="red");this.setCValue("<span>$<span style='padding-right:2px;color:"+b+";'>"+a+"",a)}; 
function eXcell_dyn(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()}}eXcell_dyn.prototype=new eXcell_ed; 
eXcell_dyn.prototype.setValue=function(a){if(!a||isNaN(Number(a)))a!==""&&(a=0);if(a>0)var b="green",c="dyn_up.gif";else a==0?(b="black",c="dyn_.gif"):(b="red",c="dyn_down.gif");this.setCValue("<div style='position:relative;padding-right:2px; width:100%;overflow:hidden; white-space:nowrap;'><img src='"+this.grid.imgURL+""+c+"' height='15' style='position:absolute;top:0px;left:0px;'><span style=' padding-left:20px; width:100%;color:"+b+";'>"+a+"</div>",a)}; 
function eXcell_ro(a){if(a)this.cell=a,this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return!0};this.getValue=function(){return this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()}}eXcell_ro.prototype=new eXcell; 
function eXcell_ron(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return!0};this.getValue=function(){return this.cell._clearCell?"":this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex).toString()}}eXcell_ron.prototype=new eXcell; 
eXcell_ron.prototype.setValue=function(a){if(a!==0&&(!a||a.toString()._dhx_trim()==""))return this.setCValue("&nbsp;"),this.cell._clearCell=!0;this.cell._clearCell=!1;this.setCValue(a?this.grid._aplNF(a,this.cell._cellIndex):"0")}; 
function eXcell_rotxt(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return!0};this.setValue=function(a){a?this.cell._clearCell=!1:(a=" ",this.cell._clearCell=!0);this.setCTxtValue(a)};this.getValue=function(){return this.cell._clearCell?"":_isIE?this.cell.innerText:this.cell.textContent}}eXcell_rotxt.prototype=new eXcell; 
function dhtmlXGridComboObject(){this.keys=new dhtmlxArray;this.values=new dhtmlxArray;this.put=function(a,b){for(var c=0;c<this.keys.length;c++)if(this.keys[c]==a)return this.values[c]=b,!0;this.values[this.values.length]=b;this.keys[this.keys.length]=a};this.get=function(a){for(var b=0;b<this.keys.length;b++)if(this.keys[b]==a)return this.values[b];return null};this.clear=function(){this.keys=new dhtmlxArray;this.values=new dhtmlxArray};this.remove=function(a){for(var b=0;b<this.keys.length;b++)if(this.keys[b]== 
a)return this.keys._dhx_removeAt(b),this.values._dhx_removeAt(b),!0};this.size=function(){for(var a=0,b=0;b<this.keys.length;b++)this.keys[b]!=null&&a++;return a};this.getKeys=function(){for(var a=[],b=0;b<this.keys.length;b++)this.keys[b]!=null&&(a[a.length]=this.keys[b]);return a};this.save=function(){this._save=[];for(var a=0;a<this.keys.length;a++)this._save[a]=[this.keys[a],this.values[a]]};this.restore=function(){if(this._save){this.keys[a]=[];this.values[a]=[];for(var a=0;a<this._save.length;a++)this.keys[a]= 
this._save[a][0],this.values[a]=this._save[a][1]}};return this}function Hashtable(){this.keys=new dhtmlxArray;this.values=new dhtmlxArray;return this}Hashtable.prototype=new dhtmlXGridComboObject; 
//v.3.6 build 130619 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/

dhtmlxtreegrid.js

//v.3.6 build 130417 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/ 
dhtmlXGridObject.prototype._updateTGRState=function(c){if(c.update&&c.id!=0){if(this.rowsAr[c.id].imgTag)this.rowsAr[c.id].imgTag.src=this.imgURL+c.state+".gif";c.update=!1}};dhtmlXGridObject.prototype.doExpand=function(c){this.editStop();var a=c.parentNode.parentNode.parentNode,b=this._h2.get[a.idd];if(this.callEvent("onOpen",[a.idd,b.state=="plus"?-1:1]))b.state=="plus"?this.expandKids(a):b.state=="minus"&&!b._closeable&&this.collapseKids(a)}; 
function dhtmlxHierarchy(){var c={id:0,childs:[],level:-1,parent:null,index:0,state:dhtmlXGridObject._emptyLineImg};this.order=[c];this.get={0:c};this.swap=function(a,b){var c=a.parent,e=a.index;c.childs[e]=b;c.childs[b.index]=a;a.index=b.index;b.index=e};this.forEachChildF=function(a,b,c,e){for(var f=this.get[a],g=0;g<f.childs.length;g++)if(b.apply(c||this,[f.childs[g]]))f.childs[g].childs.length&&this.forEachChildF(f.childs[g].id,b,c,e),e&&e.call(c||this,f.childs[g])};this.forEachChild=function(a, 
b,c){for(var e=this.get[a],f=0;f<e.childs.length;f++)b.apply(c||this,[e.childs[f]]),e.childs[f].childs.length&&this.forEachChild(e.childs[f].id,b,c)};this.change=function(a,b,c){var e=this.get[a];if(e[b]!=c)e[b]=c,e.update=!0};this.add=function(a,b){return this.addAfter(a,b)};this.addAfter=function(a,b,c,e){var f=this.get[b||0],g=c?this.get[c].index+(e?0:1):f.childs.length,h={id:a,childs:[],level:f.level+1,parent:f,index:g,state:dhtmlXGridObject._emptyLineImg};f.state==dhtmlXGridObject._emptyLineImg&& 
this.change(b,"state",b==0?"minus":"plus");if(c){for(var i=g;i<f.childs.length;i++)f.childs[i].index++;f.childs=f.childs.slice(0,g).concat([h]).concat(f.childs.slice(g,f.childs.length))}else f.childs.push(h);return this.get[a]=h};this.addBefore=function(a,b,c){return this.addAfter(a,b,c,!0)};this.remove=function(a){for(var b=this.get[a||0],c=0;c<b.childs.length;c++)this.deleteAll(b.childs[c].id);b.childs=[];b.parent.childs=b.parent.childs.slice(0,b.index).concat(b.parent.childs.slice(b.index+1)); 
for(c=b.index;c<b.parent.childs.length;c++)b.parent.childs[c].index--;delete this.get[a]};this.deleteAll=function(a){for(var b=this.get[a||0],c=0;c<b.childs.length;c++)this.deleteAll(b.childs[c].id);b.childs=[];delete this.get[a]};return this}dhtmlXGridObject.prototype._getOpenLenght=function(c,a){var b=this._h2.get[c].childs;a+=b.length;for(var d=0;d<b.length;d++)b[d].childs.length&&b[d].state=="minus"&&(a+=this._getOpenLenght(b[d].id,0));return a}; 
dhtmlXGridObject.prototype.collapseKids=function(c){var a=this._h2.get[c.idd];if(a.state=="minus"&&this.callEvent("onOpenStart",[c.idd,1])){var b=c.rowIndex;b<0&&(b=this.rowsCol._dhx_find(c)+1);this._h2.change(a.id,"state","plus");this._updateTGRState(a);if(this._srnd||this.pagingOn)this._h2_to_buff(),this._renderSort();else{for(var d=this._getOpenLenght(this.rowsCol[b-1].idd,0),e=0;e<d;e++)this.rowsCol[b+e].parentNode.removeChild(this.rowsCol[b+e]);this.rowsCol.splice(b,d)}this.callEvent("onGridReconstructed", 
[]);this.setSizes();this._h2_to_buff();this.callEvent("onOpenEnd",[c.idd,-1])}}; 
dhtmlXGridObject.prototype._massInsert=function(c,a,b){var d=[],e=_isKHTML?this.obj:this.obj.rows[0].parentNode;this._h2_to_buff();if(this._srnd||this.pagingOn)return this._renderSort();for(var f=this._getOpenLenght(c.id,0),g=0;g<f;g++){var h=this.render_row(b+g);a?a.parentNode.insertBefore(h,a):e.appendChild(h);d.push(h)}this.rowsCol=dhtmlxArray(this.rowsCol.slice(0,b).concat(d).concat(this.rowsCol.slice(b)));return c.childs.length+d.length}; 
dhtmlXGridObject.prototype.expandKids=function(c,a){var b=this._h2.get[c.idd];if(b.childs.length||b._xml_await)if(b.state=="plus"&&(b._loading||a||this.callEvent("onOpenStart",[b.id,-1]))){var d=this.getRowIndex(b.id)+1;if(b.childs.length){b._loading=!1;this._h2.change(b.id,"state","minus");this._updateTGRState(b);var e=this._massInsert(b,this.rowsCol[d],d);this.callEvent("onGridReconstructed",[])}else if(b._xml_await)b._loading=!0,this.callEvent("onDynXLS",[b.id])&&this.load(this.kidsXmlFile+""+ 
(this.kidsXmlFile.indexOf("?")!=-1?"&":"?")+"id="+b.id,this._data_type);this.setSizes();b._loading||this.callEvent("onOpenEnd",[b.id,1]);this._fixAlterCss()}};dhtmlXGridObject.prototype.kidsXmlFile=""; 
dhtmlXGridObject.prototype.sortTreeRows=function(c,a,b){var d="getValue";this.cells5({parentNode:{grid:this}},this.getColType(c)).getDate&&(d="getDate",a="str");this.forEachRow(function(b){var e=this._h2.get[b];if(e){var f=this._get_cell_value(e.buff,c,d);a=="int"?(e._sort=parseFloat(f),e._sort=isNaN(e._sort)?-99999999999999:e._sort):e._sort=f}});var e=this,f=1,g=-1;b=="des"&&(f=-1,g=1);var h=null;a=="cus"&&(h=function(a,d){return e._customSorts[c](a._sort,d._sort,b,a.id,d.id)});a=="str"&&(h=function(a, 
b){return a._sort<b._sort?g:a._sort==b._sort?0:f});a=="int"&&(h=function(a,b){return a._sort<b._sort?g:a._sort==b._sort?0:f});a=="date"&&(h=function(a,b){return(Date.parse(new Date(a._sort||"01/01/1900"))-Date.parse(new Date(b._sort||"01/01/1900")))*f});this._sortTreeRows(h,0);this._renderSort(0,!0);this.callEvent("onGridReconstructed",[])}; 
dhtmlXGridObject.prototype._sortTreeRows=function(c,a){var b=this._h2.get[a].childs;this.rowsCol.stablesort?this.rowsCol.stablesort.call(b,c):b.sort(c);for(var d=0;d<b.length;d++)b[d].childs.length&&this._sortTreeRows(c,b[d].id),b[d].index=d};dhtmlXGridObject.prototype._renderSort=function(){this._h2_to_buff();var c=this.objBox.scrollTop;this._reset_view();this.objBox.scrollTop=c}; 
dhtmlXGridObject.prototype._fixAlterCssTGR=function(){this._realfake||this._h2.forEachChild(0,function(c){if(c.buff.tagName=="TR"){var a=(this._cssSP?c.level%2:c.index%2)?this._cssUnEven:this._cssEven;this.rowsAr[c.id].className=a+(this._cssSU?" "+a+"_"+c.level:"")+" "+(this.rowsAr[c.id]._css||"")+(this.rowsAr[c.id].className.indexOf("rowselected")!=-1?" rowselected":"")}},this)}; 
dhtmlXGridObject.prototype.moveRowUDTG=function(c,a){var b=this._h2.get[c],d=b.parent.childs[b.index+a];if(d&&d.parent==b.parent){var e=[b.state,d.state];this.collapseKids(this.rowsAr[b.id]);this.collapseKids(this.rowsAr[d.id]);var f=this.rowsCol._dhx_find(this.rowsAr[c]),g=this.rowsBuffer._dhx_find(this.rowsAr[c]),h=this.obj.rows[0].parentNode.removeChild(this.rowsCol[f]),i=this.rowsCol[f+(a==1?2:a)];i?i.parentNode.insertBefore(h,i):this.obj.rows[0].parentNode.appendChild(h);this.rowsCol._dhx_swapItems(f, 
f+a);this.rowsBuffer._dhx_swapItems(g,g+a);this._h2.swap(d,b);e[0]=="minus"&&this.expandKids(this.rowsAr[b.id]);e[1]=="minus"&&this.expandKids(this.rowsAr[d.id]);this._fixAlterCss(Math.min(f,f+a))}}; 
function eXcell_tree(c){if(c)this.cell=c,this.grid=this.cell.parentNode.grid;this.isDisabled=function(){return this.cell._disabled||this.grid._edtc};this.edit=function(){if(!this.er&&!this.grid._edtc){this.er=this.cell.parentNode.valTag;this.val=this.getLabel();this.cell.atag=!this.grid.multiLine&&(_isKHTML||_isMacOS||_isFF)?"INPUT":"TEXTAREA";this.er.innerHTML="<"+this.cell.atag+" class='dhx_combo_edit' type='text' style='height:"+(this.cell.offsetHeight-6)+"px; width:100%; border:0px; margin:0px; padding:0px; padding-top:"+ 
(_isFF?1:2)+"px; overflow:hidden;'></"+this.cell.atag+">";this.er.childNodes[0].onmousedown=function(a){(a||event).cancelBubble=!0};this.er.childNodes[0].onselectstart=function(a){a||(a=event);return a.cancelBubble=!0};if(_isFF)this.er.style.top="1px";this.er.className+=" editable";this.er.firstChild.onclick=function(a){(a||event).cancelBubble=!0};this.er.firstChild.value=this.val;this.obj=this.er.firstChild;this.er.firstChild.style.width=Math.max(0,this.cell.offsetWidth-this.er.offsetLeft)+"px"; 
this.er.firstChild.focus();_isIE&&this.er.firstChild.focus()}};this.detach=function(){if(this.er){this.setLabel(this.er.firstChild.value);this.er.className=this.er.className.replace("editable","");var a=this.val!=this.er.innerHTML;if(_isFF)this.er.style.top="2px";this.obj=this.er=null;return a}};this.getValue=function(){return this.getLabel()};this.setImage=function(a){this.cell.parentNode.imgTag.nextSibling.src=this.grid.iconURL+a;this.grid._h2.get[this.cell.parentNode.idd].image=a};this.getImage= 
function(){return this.grid._h2.get[this.cell.parentNode.idd].image};this.setLabel=function(a){this.setValueA(a)};this.getLabel=function(){return this.cell.parentNode.valTag.innerHTML}}eXcell_tree.prototype=new eXcell;eXcell_tree.prototype.setValueA=function(c){this.cell.parentNode.valTag.innerHTML=c;this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,c])}; 
eXcell_tree.prototype.setValue=function(c){if(this.cell.parentNode.imgTag)return this.setLabel(c);if(this.grid._tgc.imgURL==null||this.grid._tgc.imgURL!=this.grid.imgURL){var a={};a.spacer="<img src='"+this.grid.imgURL+"blank.gif'  align='absmiddle' class='space'>";a.imst="<img src='"+this.grid.imgURL;a.imsti="<img src='"+(this.grid.iconURL||this.grid.imgURL);a.imact="' align='absmiddle'  onclick='this."+(_isKHTML?"":"parentNode.")+"parentNode.parentNode.parentNode.parentNode.grid.doExpand(this);event.cancelBubble=true;'>"; 
a.plus=a.imst+"plus.gif"+a.imact;a.minus=a.imst+"minus.gif"+a.imact;a.blank=a.imst+"blank.gif"+a.imact;a.start="<div class='treegrid_cell' style='overflow:hidden; white-space : nowrap; height:"+(_isIE?20:18)+"px;'>";a.itemim="' align='absmiddle' "+(this.grid._img_height?' height="'+this.grid._img_height+'"':"")+(this.grid._img_width?' width="'+this.grid._img_width+'"':"")+" ><span "+(_isFF||_isOpera?"style='position:relative; top:2px;'":"")+"id='nodeval'>";a.close="</div>";this.grid._tgc=a}var a= 
this.grid._tgc,b=this.cell.parentNode.idd,d=this.grid._h2.get[b];if(this.grid.kidsXmlFile||this.grid._slowParse)d.has_kids=d.has_kids||this.cell.parentNode._attrs.xmlkids&&d.state!="minus",d._xml_await=!!d.has_kids;d.image=d.image||this.cell._attrs.image||"leaf.gif";d.label=c;for(var e=[a.start],f=0;f<d.level;f++)e.push(a.spacer);d.has_kids?(e.push(a.plus),d.state="plus"):e.push(a.imst+d.state+".gif"+a.imact);e.push(a.imsti);e.push(d.image);e.push(a.itemim);e.push(d.label);e.push(a.close);this.cell.innerHTML= 
e.join("");this.cell._treeCell=!0;this.cell.parentNode.imgTag=this.cell.childNodes[0].childNodes[d.level];this.cell.parentNode.valTag=this.cell.childNodes[0].childNodes[d.level+2];if(_isKHTML)this.cell.vAlign="top";if(d.parent.id!=0&&d.parent.state=="plus")this.grid._updateTGRState(d.parent,!1),this.cell.parentNode._skipInsert=!0;this.grid.callEvent("onCellChanged",[b,this.cell._cellIndex,c])}; 
dhtmlXGridObject.prototype._process_tree_xml=function(c,a,b){this._parsing=!0;var d=!1;if(!a){this.render_row=this.render_row_tree;d=!0;a=c.getXMLTopNode(this.xml.top);b=a.getAttribute("parent")||0;b=="0"&&(b=0);if(!this._h2)this._h2=new dhtmlxHierarchy;if(this._fake)this._fake._h2=this._h2}var e=c.doXPath(this.xml.row,a);this._open=this._open||[];for(var f=0;f<e.length;f++){var g=e[f].getAttribute("id");g||(g=this.uid(),e[f].setAttribute("id",g));var h=this._h2.add(g,b);h.buff={idd:g,data:e[f],_parser:this._process_xml_row, 
_locator:this._get_xml_data};if(e[f].getAttribute("open"))h.state="minus",this._open.push(g);this.rowsAr[g]=h.buff;this._process_tree_xml(c,e[f],g)}if(d){e.length?b!=0&&!this._srnd&&this._h2.change(b,"state","minus"):this._h2.change(b,"state",dhtmlXGridObject._emptyLineImg);for(f=0;f<this._open.length;f++){var i=this._h2.get[this._open[f]];if(!i.childs.length)i.state=dhtmlXGridObject._emptyLineImg}this._updateTGRState(this._h2.get[b]);this._h2_to_buff();b!=0&&this._srnd?this.openItem(b):this.pagingOn? 
this._renderSort():this.render_dataset();if(this.kidsXmlFile)for(f=0;f<this._open.length;f++)i=this._h2.get[this._open[f]],i._xml_await&&this.expandKids({idd:i.id});this._open=[];this._slowParse===!1&&this.forEachRow(function(a){this.render_row_tree(0,a)});this._parsing=!1;b!=0&&!this._srnd&&this.callEvent("onOpenEnd",[b,1])}return c.xmlDoc.responseXML?c.xmlDoc.responseXML:c.xmlDoc}; 
dhtmlXGridObject.prototype._h2_to_buff=function(c){if(!c&&(c=this._h2.get[0],this.rowsBuffer=new dhtmlxArray,this._fake&&!this._realfake))this._fake.rowsBuffer=this.rowsBuffer;for(var a=0;a<c.childs.length;a++)this.rowsBuffer.push(c.childs[a].buff),c.childs[a].state=="minus"&&this._h2_to_buff(c.childs[a])}; 
dhtmlXGridObject.prototype.render_row_tree=function(c,a){if(a)var b=this._h2.get[a],b=b?b.buff:b;else b=this.rowsBuffer[c];if(!b)return-1;if(b._parser){if(this.rowsAr[b.idd]&&this.rowsAr[b.idd].tagName=="TR")return this._h2.get[b.idd].buff=this.rowsBuffer[c]=this.rowsAr[b.idd];var d=this._prepareRow(b.idd);this.rowsAr[b.idd]=d;a||(this.rowsBuffer[c]=d);this._h2.get[b.idd].buff=d;b._parser.call(this,d,b.data);this._postRowProcessing(d);return d}return b}; 
dhtmlXGridObject.prototype._removeTrGrRow=function(c,a){if(a)this._h2.forEachChild(a.id,function(a){this._removeTrGrRow(null,a);delete this.rowsAr[a.id]},this);else{var b=this.getRowIndex(c.idd),a=this._h2.get[c.idd];if(b!=-1&&b!==this.undefined){var d=1;a&&a.state=="minus"&&(d+=this._getOpenLenght(a.id,0));for(var e=0;e<d;e++)this.rowsCol[e+b]&&this.rowsCol[e+b].parentNode.removeChild(this.rowsCol[e+b]);if(this._fake){for(e=0;e<d;e++)this._fake.rowsCol[e+b]&&this._fake.rowsCol[e+b].parentNode.removeChild(this._fake.rowsCol[e+ 
b]);d>1&&this._fake.rowsCol.splice(b+1,d-1)}this.rowsCol.splice(b,d);this.rowsBuffer.splice(b,d)}a&&(this._removeTrGrRow(null,a),delete this.rowsAr[a.id],a.parent.childs.length==1&&(this._h2.change(a.parent.id,"state",dhtmlXGridObject._emptyLineImg),this._updateTGRState(a.parent)),this._h2.remove(a.id))}};dhtmlXGridObject.prototype.openItem=function(c){var a=this._h2.get[c||0],b=this.getRowById(c||0);b&&(a.parent&&a.parent.id!=0&&this.openItem(a.parent.id),this.expandKids(b))}; 
dhtmlXGridObject.prototype._addRowClassic=dhtmlXGridObject.prototype.addRow; 
dhtmlXGridObject.prototype.addRow=function(c,a,b,d,e,f){if(!this._h2)return this._addRowClassic(c,a,b);var d=d||0,g=this.cellType._dhx_find("tree");typeof a=="string"&&(a=a.split(this.delim));var h=this._h2.get[c];if(!h)d==0?b=this.rowsBuffer.length:(b=this.getRowIndex(d)+1,this._h2.get[d].state=="minus"?b+=this._getOpenLenght(d,0):this._skipInsert=!0);h=h||this._h2.add(c,d);h.image=e;h.has_kids=f;return h.buff=this._addRowClassic(c,a,b)}; 
dhtmlXGridObject.prototype.addRowBefore=function(c,a,b,d,e){var f=this.rowsAr[b];if(f){if(!this._h2)return this.addRow(c,a,this.getRowIndex(b));var g=this._h2.get[b].parent.id,h=this.getRowIndex(b);if(h==-1)this._skipInsert=!0;this._h2.addBefore(c,g,b);return this.addRow(c,a,h,this._h2.get[b].parent.id,d,e)}}; 
dhtmlXGridObject.prototype.addRowAfter=function(c,a,b,d,e){var f=this.rowsAr[b];if(f){if(!this._h2)return this.addRow(c,a,this.getRowIndex(b)+1);var g=this._h2.get[b].parent.id,h=this.getRowIndex(b);if(h==-1)this._skipInsert=!0;this._h2.get[b].state=="minus"?h+=this._getOpenLenght(b,0)+1:h++;this._h2.addAfter(c,g,b);return this.addRow(c,a,h,g,d,e)}};dhtmlXGridObject.prototype.enableSmartXMLParsing=function(c){this._slowParse=convertStringToBoolean(c)}; 
dhtmlXGridObject.prototype._copyTreeGridRowContent=function(c,a,b){var d=this.cellType._dhx_find("tree");for(i=0;i<c.cells.length;i++)i!=d?this.cells(b,i).setValue(this.cells(a,i).getValue()):this.cells(b,i).setValueA(this.cells(a,i).getValue())};dhtmlXGridObject.prototype.closeItem=function(c){var a=this.getRowById(c);a&&this.collapseKids(a)};dhtmlXGridObject.prototype.deleteChildItems=function(c){var a=this._h2.get[c];if(a)for(;a.childs.length;)this.deleteRow(a.childs[0].id)}; 
dhtmlXGridObject.prototype.getAllSubItems=function(c){var a=[],b=this._h2.get[c||0];if(b)for(var d=0;d<b.childs.length;d++)a.push(b.childs[d].id),b.childs[d].childs.length&&(a=a.concat(this.getAllSubItems(b.childs[d].id).split(this.delim)));return a.join(this.delim)};dhtmlXGridObject.prototype.getChildItemIdByIndex=function(c,a){var b=this._h2.get[c||0];return!b?null:b.childs[a]?b.childs[a].id:null};dhtmlXGridObject.prototype.getItemText=function(c){return this.cells(c,this.cellType._dhx_find("tree")).getLabel()}; 
dhtmlXGridObject.prototype.getOpenState=function(c){var a=this._h2.get[c||0];if(a)return a.state=="minus"?!0:!1};dhtmlXGridObject.prototype.getParentId=function(c){var a=this._h2.get[c||0];return!a||!a.parent?null:a.parent.id};dhtmlXGridObject.prototype.getSubItems=function(c){var a=[],b=this._h2.get[c||0];if(b)for(var d=0;d<b.childs.length;d++)a.push(b.childs[d].id);return a.join(this.delim)}; 
dhtmlXGridObject.prototype.expandAll=function(c){this._renderAllExpand(c||0);this._h2_to_buff();this._reset_view();this.setSizes();this.callEvent("onGridReconstructed",[]);this._redrawLines&&this._redrawLines()};dhtmlXGridObject.prototype._renderAllExpand=function(c){for(var a=this._h2.get[c].childs,b=0;b<a.length;b++)a[b].childs.length&&(this._h2.change(a[b].id,"state","minus"),this._updateTGRState(a[b]),this._renderAllExpand(a[b].id))}; 
dhtmlXGridObject.prototype.collapseAll=function(c){this._h2.forEachChild(c||0,function(a){if(a&&a.state=="minus")a.state="plus",a.update=!0,this._updateTGRState(a)},this);this._h2_to_buff();this._reset_view();this.setSizes();this.callEvent("onGridReconstructed",[]);this._redrawLines&&this._redrawLines()};dhtmlXGridObject.prototype.hasChildren=function(c){var a=this._h2.get[c];return a&&a.childs.length?a.childs.length:a._xml_await?-1:0}; 
dhtmlXGridObject.prototype.setItemCloseable=function(c,a){var b=this._h2.get[c];if(b)b._closeable=!convertStringToBoolean(a)};dhtmlXGridObject.prototype.setItemText=function(c,a){return this.cells(c,this.cellType._dhx_find("tree")).setLabel(a)};dhtmlXGridObject.prototype.setItemImage=function(c,a){this._h2.get[c].image=a;this.rowsAr[c].imgTag.nextSibling.src=(this.iconURL||"")+a};dhtmlXGridObject.prototype.getItemImage=function(c){this.getRowById(c);return this._h2.get[c].image}; 
dhtmlXGridObject.prototype.setImageSize=function(c,a){this._img_width=c;this._img_height=a};dhtmlXGridObject.prototype._getRowImage=function(c){return this._h2.get[c.idd].image};dhtmlXGridObject.prototype.setOnOpenStartHandler=function(c){this.attachEvent("onOpenStart",c)};dhtmlXGridObject.prototype.setOnOpenEndHandler=function(c){this.attachEvent("onOpenEnd",c)};dhtmlXGridObject.prototype.enableTreeCellEdit=function(c){this._edtc=!convertStringToBoolean(c)}; 
dhtmlXGridObject.prototype.getLevel=function(c){var a=this._h2.get[c||0];return!a?-1:a.level};dhtmlXGridObject.prototype._fixHiddenRowsAllTG=function(c,a){for(i in this.rowsAr)if(this.rowsAr[i]&&this.rowsAr[i].childNodes)this.rowsAr[i].childNodes[c].style.display=a};dhtmlXGridObject._emptyLineImg="blank"; 
//v.3.6 build 130417 
/* 
Copyright DHTMLX LTD. http://www.dhtmlx.com 
To use this component please contact [email protected] to obtain license 
*/

 

1、导入关键文件

<link rel="STYLESHEET" type="text/css" 
href="../dhtmlxGrid/codebase/dhtmlxgrid.css"/> 
<script src="../dhtmlxGrid/codebase/dhtmlxcommon.js"/> 
<script src="../dhtmlxGrid/codebase/dhtmlxgrid.js"/> 
<script src="../dhtmlxGrid/codebase/dhtmlxgridcell.js"/> 
<script src="../dhtmlxTreeGrid/codebase/dhtmlxtreegrid.js"/>

 

2、初始化

<div id="gridbox" width="100%" height="250px" style="overflow:hidden"/> 
<script> 
mygrid = new dhtmlXGridObject('gridbox');  
//xml文件中图片的路径 
    mygrid.setImagePath("<%=url%>Grid/codebase/imgs/icons_books/"; 
mygrid.setHeader("Tree,Plain Text,Long Text,Color,Checkbox");  
//列类型(要显示为树行结构第一列必值须为tree,ed为可编辑,txt为文本框…) 
    mygrid.setColTypes("tree,ed,txt,ch,ch"); 
mygrid.init();  
mygrid.loadXML("test_list_1.xml"); 
</script>

 

3、基本XML结构(基本机构就是使用row的嵌套达到树形效果)

<?xml version="1.0" encoding="UTF-8"?> 
<rows> 
<row id="h1"> 
<cell image="folder.gif">Honda</cell> 
<cell>...</cell> 
<cell>...</cell> 
<row id=“c1”> 
<cell image="folder.gif">Honda</cell> 
<cell>...</cell> 
<cell>...</cell> 
<row> 
</row> 
</rows>

 

关键词定位功能实现

具体的实现方法可以参考博文:Dhtmlx TreeGrid关键词定位功能实现

简单算数运算实现(求和)

1、导入关键文件:

<script  src="<%=url%>Grid/codebase/ext/dhtmlxgrid_math.js"/>

 

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/13261.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论