var commonGridObj_Chequebooks; function initWinScreen() { var winScreenHeight = 0; var winScreenWidth = 0; if(window.screen.height) { winScreenHeight = window.screen.height; } if(window.screen.width) { winScreenWidth = window.screen.width; } if(winScreenWidth >= 1440 && winScreenWidth >= 900) { document.getElementById("mygrid_container_Chequebook").style.height = "520px"; } else if(winScreenWidth >= 1366 && winScreenWidth >= 768) { document.getElementById("mygrid_container_Chequebook").style.height = "340px"; } else if(winScreenWidth >= 1024 && winScreenWidth >= 768) { document.getElementById("mygrid_container_Chequebook").style.height = "300px"; } } function createGrid() { //header var headerArgs_Chequebook = new Array("","支票系统名称","支票中文名称","支票代码号","支票起始号","支票结束号","支票总数","是否锁定","是否删除","创建人","创建时间","支票币别"); //width var widthArgs_Chequebook = new Array("40","150","150","150","150","150","120","70","70","120","120","70"); //column align var colAlignArgs_Chequebook = new Array("center","center","center","center","center","center","center","center","center","center","center","center"); //column sort var colSortArgs_Chequebook = new Array("na","str","str","str","str","str","str","str","str","str","str","str"); //column type var colTypeArgs_Chequebook = new Array("ch","ro","ro","ro","ro","ro","ro","ch","ch","ro","ro","ro"); commonGridObj_Chequebooks = new TGridCommon("mygrid_container_Chequebook","form1",headerArgs_Chequebook,widthArgs_Chequebook,colAlignArgs_Chequebook,colSortArgs_Chequebook,colTypeArgs_Chequebook); commonGridObj_Chequebooks.setResponseUrl("ChequeBooksGridSource.aspx"); commonGridObj_Chequebooks.setRequest("ChequeBooksGridSource.aspx?handle=booklist&show_page=15&cur_page=1&uid="+commonGridObj_Chequebooks.newGuid()); commonGridObj_Chequebooks.setSourceType("json"); commonGridObj_Chequebooks.setSkin("xp"); commonGridObj_Chequebooks.setImageUrl("../images/"); commonGridObj_Chequebooks.initGrid(); commonGridObj_Chequebooks.bind(); commonGridObj_Chequebooks.initPageByHandle("booklist"); commonGridObj_Chequebooks.getGridObj().attachEvent("onRowDblClicked", function(id,ind){ var openSet = "height=490, width=800, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-490)/2 + ",Left= "+(screen.width-800)/2 var openType = "_blank"; var openUrl = "ChequeBooksInfo.aspx?handle=edit&id="+id; window.open (openUrl,openType,openSet); }); commonGridObj_Chequebooks.clickEvent = function(){ commonGridObj_Chequebooks.getGridObj().attachEvent("onRowDblClicked", function(id,ind){ var openSet = "height=490, width=800, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-490)/2 + ",Left= "+(screen.width-800)/2 var openType = "_blank"; var openUrl = "ChequeBooksInfo.aspx?handle=edit&id="+id; window.open (openUrl,openType,openSet); }); } commonGridObj_Chequebooks.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){ if(stage == 0){ if(cInd != 0){ return false; }else{ return true; } } }); commonGridObj_Chequebooks.onEditEvent = function(){ commonGridObj_Chequebooks.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){ if(stage == 0){ if(cInd != 0){ return false; }else{ return true; } } }); } } function addChequeBook(){ var openSet = "height=490, width=800, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " +(screen.height-490)/2 + ",Left= "+(screen.width-800)/2 var openType = "_blank"; var openUrl = "ChequeBooksInfo.aspx?handle=add"; window.open (openUrl,openType,openSet); } function refreshList(){ createGrid(); }