var commonGridObj_invoicebooks; function $(id){ return document.getElementById(id); } function createGrid(){ //header var headerArgs_invoicebook = new Array("","发票系统名称","发票中文名称","发票代码号","发票起始号","发票结束号","发票总数","是否锁定","是否删除","创建人","创建时间"); //width var widthArgs_invoicebook = new Array("40","150","150","150","150","150","120","70","70","120","120"); //column align var colAlignArgs_invoicebook = new Array("center","center","center","center","center","center","center","center","center","center","center"); //column sort var colSortArgs_invoicebook = new Array("na","str","str","str","str","str","str","str","str","str","str"); //column type var colTypeArgs_invoicebook = new Array("ch","ro","ro","ro","ro","ro","ro","ch","ch","ro","ro"); commonGridObj_invoicebooks = new TGridCommon("mygrid_container_invoicebook","form1",headerArgs_invoicebook,widthArgs_invoicebook,colAlignArgs_invoicebook,colSortArgs_invoicebook,colTypeArgs_invoicebook); commonGridObj_invoicebooks.setResponseUrl("InvoiceBookGridSource.aspx"); commonGridObj_invoicebooks.setRequest("InvoiceBookGridSource.aspx?handle=booklist&show_page=15&cur_page=1&uid="+commonGridObj_invoicebooks.newGuid()); commonGridObj_invoicebooks.setSourceType("json"); commonGridObj_invoicebooks.setSkin("xp"); commonGridObj_invoicebooks.setImageUrl("../images/"); commonGridObj_invoicebooks.initGrid(); commonGridObj_invoicebooks.bind(); commonGridObj_invoicebooks.initPageByHandle("booklist"); commonGridObj_invoicebooks.getGridObj().attachEvent("onRowSelect", 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 = "InvoiceBookEdit.aspx?handle=edit&id="+id; window.open (openUrl,openType,openSet); }); commonGridObj_invoicebooks.clickEvent = function(){ commonGridObj_invoicebooks.getGridObj().attachEvent("onRowSelect", 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 = "InvoiceBookEdit.aspx?handle=edit&id="+id; window.open (openUrl,openType,openSet); }); } commonGridObj_invoicebooks.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){ if(stage == 0){ if(cInd != 0){ return false; }else{ return true; } } }); commonGridObj_invoicebooks.onEditEvent = function(){ commonGridObj_invoicebooks.getGridObj().attachEvent("onEditCell",function(stage,rId,cInd,nValue,oValue){ if(stage == 0){ if(cInd != 0){ return false; }else{ return true; } } }); } } function addInvoiceBook(){ 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 = "InvoiceBookEdit.aspx?handle=add"; window.open (openUrl,openType,openSet); } function deleteUnpostApplication(){ var iCount = 0; var iSucce = 0; var iFail = 0; if(commonGridObj_invoicebooks != null){ for(var i=0;i