⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calculategrid.htc

📁 HTC,demo WEB用于。 超大型
💻 HTC
📖 第 1 页 / 共 5 页
字号:
        }

        function getFirstPosition(){//返回当前页第一条记录的位置
          return oPageSize*(curPage-1) + 1;
        }

        function getLastPosition(){//返回当前页最后一条记录的位置
          return parseInt(oPageSize*(curPage-1)) + parseInt(oPageSize);
        }

        function moveFirst(){//移动到第一页
          curPage = 1;
          oControl.curPage.text = curPage;
          fillInTable();
          oControl.firstPage.disabled = true; 
          oControl.previousPage.disabled = true;
          if(oControl.lastPage.disabled == true && oControl.nextPage.disabled == true){
            oControl.lastPage.disabled = false; 
            oControl.nextPage.disabled = false;
          }
          /*
           if(hasPageFooter == "true")//是否显示页脚行
            viewPageFooter(); 
            */
        }

        function movePrevious(){//移动到上一页
          if(curPage>1)
            curPage--;
          if(curPage==1){
            oControl.firstPage.disabled = true; 
              oControl.previousPage.disabled = true;
          }
            oControl.curPage.text = curPage;
            fillInTable();
          if(oControl.lastPage.disabled == true && oControl.nextPage.disabled == true){
            oControl.lastPage.disabled = false; 
            oControl.nextPage.disabled = false;
          }
          /*
           if(hasPageFooter == "true")//是否显示页脚行
            viewPageFooter(); 
            */
        }

        function moveNext(){//移动到下一页
          if(curPage<getPageNumber())
            curPage++;
          if(curPage==getPageNumber()){//当前页是最后一页,则使尾页按钮和下一页按钮失效
            oControl.lastPage.disabled = true;  
            oControl.nextPage.disabled = true;
          }
            oControl.curPage.text = curPage;
            fillInTable();
            
          if(oControl.firstPage.disabled == true && oControl.previousPage.disabled == true){//处理首页按钮和上一页按钮
            oControl.firstPage.disabled = false;  
            oControl.previousPage.disabled = false;
          }
          /*
           if(hasPageFooter == "true")//是否显示页脚行
            viewPageFooter(); 
            */
        }

        function moveLast(){//移动到最后一页
          curPage = getPageNumber();
          oControl.curPage.text = curPage;  
          oControl.lastPage.disabled = true;  
          oControl.nextPage.disabled = true;  
          if(oControl.firstPage.disabled == true && oControl.previousPage.disabled == true){//处理首页按钮和上一页按钮
            oControl.firstPage.disabled = false;  
            oControl.previousPage.disabled = false;
          }   
          fillInTable();
           
          /*
           if(hasPageFooter == "true")//是否显示页脚行
            viewPageFooter(); 
            */
        }

  ////////////////////////////////////////////分页控制代码结束//////////////////////////////////////////////

        function dbclickCell(){ //双击dataTable的时候变为可编辑状态                   
          
          var strValueCol;
          var strTextCol; 
          
          if(event.srcElement.tagName.toLowerCase()=="table" || event.srcElement.tagName.toLowerCase()=="tr") return;
          
          if(editMode.toString() == "true"){//允许编辑表格
            var vTop,vLeft,vWidth,vHeight;//用来定义输入框的位置              
            oCurCell = event.srcElement;//当前的Cell对象                            
            
            vTop = oCurCell.offsetTop + oTBody.offsetTop - oTBody.scrollTop;
            vLeft = oCurCell.offsetLeft + oTBody.offsetLeft - oTBody.scrollLeft;
            vWidth = oCurCell.offsetWidth + 1;
            vHeight = oCurCell.offsetHeight + 1;

            if(tableRow==-1 || tableCol==-1) return;
              vPreviousRow = tableRow;//保存相对行坐标
              vPreviousRowForXML = parseInt(tableRow) + (parseInt(curPage)-1)*oPageSize;//保存当前操作cell行坐标
              vPreviousCol = tableCol;//保存当前操作cell列坐标  
              //
              var vCurrentRow = parseInt(tableRow) + (parseInt(curPage)-1)*oPageSize;
              var vDataType =  oTitleTable.rows(0).cells(tableCol).children(0).getAttribute("DataType"); //寻找对应的DataType                   
              
              strValueCol = oTitleTable.rows(0).cells(tableCol).children(0).getAttribute("valueCol");
              strTextCol = oTitleTable.rows(0).cells(tableCol).children(0).getAttribute("textCol");
                            
              
              oPreviousRowXMLData = getXMLData(vCurrentRow);//当焦点失去时候用来和修改后的行XML数据对象进行比较以
                                                            //确定该行是否已被修改      
            
            var oSrc = oTitleTable.rows(0).cells(tableCol).childNodes(0); //取得双击的td对象对应的Title对象TD
            if(oSrc.EditType==null) return;
                              
              switch(oSrc.EditType.toLowerCase()){
                case "s"://不可编辑的选择框
                  oEditor = objSEC;
                  with(oEditor){
                    clear = "1";
                    top = vTop;
                    left = vLeft;
                    width = vWidth;
                    height = vHeight;               
                    valueCol = strValueCol;
                    textCol = strTextCol;
                    xmlSource = secSource();
                    visible = true;
                    style.display = "block";
                    expand = true;                        
                  }
                  break;

                case "l"://可编辑的选择框
                  oEditor = objCombo;               
                  with(oEditor){
                    clear = "1";
                    top = vTop;
                    left = vLeft;
                    width = vWidth;
                    height = vHeight;
                    valueCol = strValueCol;
                    textCol = strTextCol;
                    xmlSource = secSource();
                    visible = true;
                    style.display = "block";
                    expand = true;                        
                  }
                  break;

                case "i"://标准的maskEdit
                  oEditor = objMaskEdit
                  curContent = oCurCell.innerText;
                  oCurCell.innerText = "";                      

                  with(oEditor){
                    top = vTop - 1;
                    left = vLeft - 1;
                    width = vWidth -1;
                    height = vHeight;
                    refresh = "1";
                    style.display = "block";
                    text = curContent;  
                    //此处需要对maskEdit能接受的数据类型dataType进行设置
                    //该设置需和title.xml中r节点的DataType属性相对应  
                    dataType =  vDataType;//正则验证规则                
                  }
                  //oEditor.childNodes(1).childNodes(0)指的是maskEdit里面的input,
                  //如果这里出现错误,一般都考虑是否是maskEdit的DHTML结构又发生了变化
                  oEditor.childNodes(1).childNodes(0).focus();
                  break;

                case "d"://日期选择框
                  oEditor = objDatePicker                     
                  curContent = oCurCell.innerText;
                  oCurCell.innerText = "";
                  with(oEditor){
                    top = vTop + 1;
                    left = vLeft;
                    width = vWidth ;
                    height = vHeight - 1;
                    refresh = "1";
                    style.display = "block";
                    text = curContent;                      
                  }
                  break;
                  
                case "ta"://TextArea
                  oEditor = objTA;  
                  curContent = oCurCell.innerText;
                  oCurCell.innerText = "";
                  with(oEditor){
                    style.top = vTop + 1;
                    style.left = vLeft - 1;
                    style.width = vWidth -1;
                    style.height = vHeight -3;              
                    style.display = "block";
                    value = curContent;                     
                  }
                  break; 
                  
                case "q"://QInput
                  oEditor = objQInput;  
                  curContent = oCurCell.innerText;
                  oCurCell.innerText = "";
                  with(oEditor){
                    top = vTop - 1;
                    left = vLeft - 10;
                    width = vWidth-1;                 
                    height = vHeight + 1;
                    xmlSource = secSource();                  
                    codeCol = strValueCol;
                    textCol = strTextCol;                 
                    Lwidth = vWidth + 20;       
                    style.display = "block";
                    text = curContent;
                    refresh();
                  }
                  break;
                               
                case "n"://不可编辑               
                  break;

                default:
                  break;
              }
            }
          }

          function secSource(rpropName){ //得到sec editor的数据
            var vRPropName;
            var vSource;
            if(typeof(rpropName) != "undefined"){
              vRPropName = rpropName;
            }else{
              vRPropName = oTitleTable.rows(0).cells(tableCol).children(0).getAttribute("rpropName"); //寻找对应的RPropName
            }
            if(!vRPropName) return null;
            vSource = "<?xml version='1.0' encoding='gb2312'?>" + oTitleXML.selectSingleNode("/*/*[@rpropName ='" + vRPropName + "']").xml;

            return inputXML(vSource);
          }

          function createEditor(){ //创建编辑组件 初始化时执行  
            
            //TextArea(文字输入域)        
            objTA = window.document.createElement("<textarea class='phms_dbgrid_ta'></textarea>"); //TextArea,用于文字输入
            objTA = element.appendChild(objTA);
            objTA.style.display = "none";

            //sec(只选下拉框)
            objSEC = window.document.createElement("<phms:sec comStyle='dropdown' init='1'></phms:sec>"); //sec组件
            objSEC = element.appendChild(objSEC);
            objSEC.style.display = "none";

            //sec(combo组合框可选可填)
            objCombo = window.document.createElement("<phms:sec comStyle='combo' init='1'></phms:sec>"); //combo sec组件
            objCombo = element.appendChild(objCombo);
            objCombo.style.display = "none";

            //maskedit  
            objMaskEdit = window.document.createElement("<phms:maskedit dataType='phms_Common' init='1'/>");//maskEdit组件
            objMaskEdit = element.appendChild(objMaskEdit);
            objMaskEdit.style.display = "none";     

            //datepicker
            objDatePicker = window.document.createElement("<phms:datepicker init='1' expand='false'/>");//datepicker组件
            objDatePicker = element.appendChild(objDatePicker);
            objDatePicker.style.display = "none";   
            
            //TextArea
            objTextArea = window.document.createElement("<textarea class=''>");//TextArea
            objTextArea = element.appendChild(objTextArea);
            objTextArea.style.display = "none";   
            
            //CheckBox
            objCheckBox = window.document.createElement("<input type='checkbox'>");//CheckBox
            obj

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -