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

📄 page.js

📁 基于SSH (struts+spring+hibernate)框架设计的 CRM客户关系管理系统
💻 JS
字号:
//调用本js需要指定全局变量 nPageSum--总页数
//需要有函数function query()进行查询
//每行数据 <tr>必须指定id(记录的id值)

// 当前行对象变量
var oCurrRow = null;
var delTrue=true;
//要查询的页
var curr_page;
//是否需要查询
var isQuery=true;


//选定表格行函数
//并得到选中行的id值
var selectedId="";

function SelectRow(oRow)
{
  // 如果有曾选定过的行, 则恢复此行为未选定状态
  if(oCurrRow)
  {  
   	oCurrRow.style.backgroundColor="";
  	oCurrRow.style.bordercolorlight="";
  	oCurrRow.style.bordercolorlight="";
  }

  // 设置新的选定行的状态
  oRow.style.backgroundColor = '#66ccff'
  oCurrRow = oRow;
  selectedId = oRow.id;
}

//页面跳转
function GoToPage(Num)
{		
	if(Num==0){
		       if (frmPage.txtPageNo.value == ""
		          || frmPage.txtPageNo.value == "0"
		          || isNaN(frmPage.txtPageNo.value)
		          || frmPage.txtPageNo.value.indexOf('.') != -1)
		       {
		          alert("请输入正确的正整数!");
		          frmPage.txtPageNo.focus();
		          return;
		       }
		       if (nPageSum  < eval(frmPage.txtPageNo.value))
		       {
		          alert("输入的数字不能大于总页数!");
		          frmPage.txtPageNo.focus();
		          return;
		       }
		       if (0 - eval(frmPage.txtPageNo.value) > 0)
		       {
		          alert("输入的数字不能是负数!");
		          frmPage.txtPageNo.focus();
		          return;
		       } 
		       curr_page=frmPage.txtPageNo.value;
       }else{
       	       curr_page=Num;
       }
       //需要查询
       if(isQuery){       
       		Query();       		
       }
}
//错误提示
function begEndPrompt(position,i){
	if(position=="BEGIN"){
		alert("已经到达首页!");
	}
	if(position=="END"){
		alert("已经到达末页!");
	}
	return i;
}


//打开右键菜单
function openShortCutMenu(oRow)
{
  // 选中当前行
  SelectRow(oRow);
  aOpenPopMenu("ShortCutMenu");
  event.cancelBubble = true;
  event.returnValue = false;
}
function CloseShortCutMenu(){
	   aClosePopMenu("ShortCutMenu");
}
function aOpenPopMenu(MenuId){
    if (document.all(MenuId)){
    	document.all(MenuId).style.left = event.clientX + document.body.scrollLeft;
  		document.all(MenuId).style.top = event.clientY + document.body.scrollTop;
  		document.all(MenuId).style.display = "";
    }
}

function aClosePopMenu(MenuId){
    if (document.all(MenuId)){
       document.all(MenuId).style.display = "none";
    }
}

⌨️ 快捷键说明

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