function initComplete(){ /** * 工具条 */ var roleCons = roleButtonArr(); var toolBarOpt1 = { items:[ {text: '新增', click: "addUnit", iconClass: 'add1_tem',id:"10000"}, {text: '删除', click: "deleteUnit", iconClass: 'delete_tem',id:"10002"}, {text: '修改', click: "updateUnit", iconClass: 'update_tem',id:"10001"}, {text: '查看', click: "onView", iconClass: 'view_tem',id:"10003"} ], roleCons:roleCons }; /** * 树形列 */ var grid_option1 = { columns: [ { display: '源站名称', name: 'NAME_219', align: 'center', width: "30%",isPrimaryKey:true, render : function(rowdata, value) { return ''+ rowdata.NAME_219 +''; } }, { display: '源站URL', name: 'SOURCE_URL_219', align: 'center', width: "70%"} ], rownumbers : true, checkbox : true, pageSize : 10, percentWidthMode : true }; var options1={ url :'/nwyj/ws/crud/CRUDService/queryQui', params:loadParams, height: '100%', width:"100%", gridOptions:grid_option1, singleRecodeOptions:{a:"aa"}, paperOpration:{showInput:"true"}, toolBarOptions:toolBarOpt1 }; g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1); } //点击查看 function jumpPage(id){ window.location.href="configuration-update.jsp?"+id; } //新增 function addUnit(){ window.location.href="configuration-update.jsp"; } //修改 function updateUnit(){ var rows = g.getSelectedRows(); if(rows.length==0){ top.Dialog.alert("请选择一条记录"); return; } if(rows.length>1){ top.Dialog.alert("只能选择一条记录"); return; } var fd_id = rows[0].FD_OBJECTID219; window.location.href="configuration-update.jsp?"+fd_id; } //删除 function deleteUnit(){ var rows = g.getSelectedRows(); var rowsLength = rows.length; if (rowsLength == 0) { top.Dialog.alert("请选中要删除的记录!"); return; } var ids = ""; for ( var i = 0; i < rowsLength; i++) { ids += rows[i].FD_OBJECTID219 + ","; } top.Dialog.confirm("确定要删除吗?|删除", function() { // 删除记录 $.post($.pathname() +"/ws/crud/CRUDService/delete/", { "objectIDs" : ids, classid : 219 }, function(result) { if (result.Msg.sucsess == true) { $.messager.alert("删除成功",null,null,null,1); // 刷新表格数据 g.rend(); } else { top.Dialog.alert("删除失败!"); } }, "json"); }); } //详情 function onView(){ var rows = g.getSelectedRows(); if(rows.length==0){ top.Dialog.alert("请选择一条记录"); return; } if(rows.length>1){ top.Dialog.alert("只能选择一条记录"); return; } var fd_id = rows[0].FD_OBJECTID219; window.location.href="configuration-update.jsp?"+fd_id; }