从北京回到济南,参与啦内控系统的开发,对于在北京干了三个月的运维工作,我真是不想说太多!太多的辛酸太多的累,关键是碰见一个变态的领导。
这是回济南参与新项目的学习,关于DHTMLXLX,这个功能主要是关于内控字典的维护,增删改查。
function initLayout()//初始化界面布局
{
dhxLayout=new dhtmlXLayoutObject(document.body,"3T","dhx_skyblue");
dhxLayout.setEffect("resize",false);
dhxLayout.setEffect("collapse",false);
dhxLayout.setEffect("highlight",true);
dhxLayout.cells("a").setHeight(60);
dhxLayout.cells("b").setWidth(240);
dhxLayout.cells("b").collapse();
dhxLayout.cells("a").setText("字典数据维护");
dhxLayout.cells("a").attachObject("cellA");
dhxLayout.setAutoSize("c","b;c");
//dhxLayout.cells("a").fixSize(false,false);
dhtmlExtTools.hideLayoutCellButton(dhxLayout.cells("c"));//将cell C 上的那快隐藏掉
//添加工具栏
dhxToolBar=dhxLayout.cells("c").attachToolbar();
dhxToolBar.setIconsPath("<%=path %>/Images/Buttons/");
btIndex=0;
dhxToolBar.addButton("add",btIndex++,"增加","Add.gif","Add.gif");
dhxToolBar.addSeparator("sep1",btIndex++);
dhxToolBar.addButton("update","修改","Edit.gif","Edit.gif");
dhxToolBar.addSeparator("sep2",btIndex++);
dhxToolBar.addButton("delete","删除","Delete.gif","Delete.gif");
dhxToolBar.setAlign("right");
dhxToolBar.attachEvent("onClick",function(id){
if(id=="add")
{
addNewTree();//这个函数不是添加新的书的意思 而是是分级结构的字典记录添加方法
}
if(id=="update")//
{
updateThis();
}
if(id=="delete")
{
deleteThis();
}
});
}
/*
* 加载树级机构
*/
function LoadTree(dhxLayout)
{
dhxTree=dhxLayout.cells("b").attachTree();
dhxLayout.cells("b").expand();
var cid="";// 打开的当前ID
var level="";// 当前级别
dhxTree.setSkin('bluebooks');
dhxTree.setImagePath("<%=path %>/JsCss/Dhtml/dhtmlxTree/codebase/imgs/csh_bluebooks/");
dhxTree.enableDragAndDrop(false);
//****************************************//
dhxTree.setXMLAutoLoading("<%=path%>/Wsbx/Xtgl/ZdwhManager/NewZdwh.do?Fn=initTree&ZDBH="+config[0]+"&DWBH="+<%=dqgs%>+"&FJJG="+config[3]) ;//加载的分级字典的XML
dhxTree.loadXML("<%=path%>/Wsbx/Xtgl/ZdwhManager/NewZdwh.do?Fn=initTree&ZDBH="+config[0]+"&DWBH="+<%=dqgs%>+"&FJJG="+config[3]);
dhxTree.enableLoadingItem("加载中...");
//添加监听事件
//1.双击非明细菜单动态加载数据
dhxTree.attachEvent("onDblClick",function(id){
cid = id;
level = dhxTree.getUserData(id,"js");
dhxTree.setXMLAutoLoading("<%=path%>/Wsbx/Xtgl/ZdwhManager/NewZdwh.do?Fn=dynTree&js="+level+"&ID="+cid+"&DWBH="+<%=dqgs%>+"&ZDBH="+config[0]+"&FJJG="+config[3]);
return true;
});
//2.单机加号+非明细动态加载数据
dhxTree.attachEvent("onOpenStart","js");
dhxTree.setXMLAutoLoading("<%=path%>/Wsbx/Xtgl/ZdwhManager/NewZdwh.do?Fn=dynTree&js="+level+"&ID="+cid+"&DWBH="+<%=dqgs%>+"&ZDBH="+config[0]+"&FJJG="+config[3]);
return true;
});
// 选预选框时执行查询,加载grid
dhxTree.attachEvent("onSelect",function(id){
cid = id;//F_SJBH-F_ZDBH
level = dhxTree.getUserData(id,"js");
loadGrid(dhxLayout,level,cid);
});
}
//加载Grid表格
function loadGrid(dhxLayout,cid)
{
dhxGrid=dhxLayout.cells("c").attachGrid();
dhxGrid.setImagePath("<%=path %>/JsCss/dhtmlGrid/codebase/imgs/");
dhxGrid.setHeader("序号,数据编号,数据名称,数据等级,显示顺序,使用状态,备注");
dhxGrid.setInitWidths("80,120,120");
dhxGrid.setColAlign("left,left,left");
dhxGrid.setColTypes("ro,ro,ro");
dhxGrid.setColSorting("str,str,str");
dhxGrid.init();
dhxGrid.setSkin("dhx_skyblue");
if(config[1]=="1")
{
dhxGrid.loadXML("<%=path%>/Wsbx/Xtgl/ZdwhManager/NewZdwh.do?Fn=loadGrid&JS="+level+"&ID="+cid+"&DWBH="+<%=dqgs%>+"&ZDBH="+config[0]+"&FJJG="+config[3]);
}
else if(config[1]=="0")
{
dhxLayout.cells("b").collapse();
dhxGrid.loadXML("<%=path%>/Wsbx/Xtgl/ZdwhManager/NewZdwh.do?Fn=loadGridNOFJ&ZDBH="+config[0]+"&DWBH="+<%=dqgs%>);
}
}