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

📄 dbgridfiles.js

📁 本系统的使用可以将工作的部分流程使用计算机的办公自动化处理
💻 JS
字号:
var PreRowObj="";
var bDescending=false;
var iCellIndex;
var iRowIndex=0;

//滚动信息
function SynScroll()
{
  HeaderSpan.scrollLeft = event.srcElement.scrollLeft;  
}

//选中信息
function selectThis(theRowObj)
{
	if (PreRowObj!="")
   	ListTable.rows(PreRowObj).className=""; 
 	theRowObj.className="selectColor";		
 	PreRowObj=theRowObj.id;
 	
 	return theRowObj;

}


//点击鼠标右键
function ContextMenu()
{
	

}

function initScrollTable(oElement) 
{	
	if (ListTable.rows.length>0)
	{
		resizeScrollTable(oElement);
		oElement.firstChild.syncTo = oElement.lastChild.uniqueID;
		oElement.firstChild.syncDirection = "horizontal";
		oElement.attachEvent("onresize", function () {
			resizeScrollTable(oElement);
		});
	}
}

function resizeScrollTable(oElement) 
{
	var head = oElement.firstChild;
	var headTable = head.firstChild;
	var body = oElement.lastChild;
	var bodyTable = body.firstChild;
		body.style.height = Math.max(0, oElement.clientHeight - head.offsetHeight);
	
	var scrollBarWidth = body.offsetWidth - body.clientWidth;
	
	// set width of the table in the head
	headTable.style.width = Math.max(0, Math.max(bodyTable.offsetWidth + scrollBarWidth, oElement.clientWidth));

	// go through each cell in the head and resize
	var headCells = headTable.rows[0].cells;
	var bodyCells = bodyTable.rows[0].cells;
	
	for (var i = 0; i < bodyCells.length; i++)
		//alert(i+"/"+bodyCells.length+" : "+headCells[i].offsetWidth+"   "+bodyCells[i].offsetWidth);
		headCells[i].style.width = Math.max(headCells[i].offsetWidth,bodyCells[i].offsetWidth);
    ResizeAll();
}

///////////////////////////////
//
//排序
//
//////////////////////////////


function sortByThis()
{
  if (iCellIndex==null)
  	iCellIndex=event.srcElement.cellsIndex;
  if (iCellIndex==event.srcElement.cellsIndex)
  	bDescending=!bDescending;
  else
  	bDescending=false;
  	
  iCellIndex=event.srcElement.cellsIndex;
  


}


///////////////////////////////////////////
//
//排序结束
//
/////////////////////////////////////////////////

function changeRow()
{//alert("changeRow");
	
/*	var theRow;
	if (event.keyCode==40) //下箭头
	 {
		 	if (PreRowObj==null || PreRowObj=="")
		 		iRowIndex=0;
		 	else
		 	{
		 		if (iRowIndex==ListTable.rows.length-1)
		 			 return false;
		 		iRowIndex=ListTable.rows(PreRowObj).rowIndex+1;
		 	}
	 
	 }
	 
	 if (event.keyCode==38) //上箭头
	 {
		  if (PreRowObj==null || PreRowObj=="")
		 		iRowIndex=0;
		 	else
		 	{
		 		if (iRowIndex==0)
		 			return false;		 			
		 		iRowIndex=ListTable.rows(PreRowObj).rowIndex-1;
		 	}
	 
	 }

	 theRow=ListTable.rows(iRowIndex);	 
	 selectThis(theRow);	 
	 */
}


//document.onselectstart=function(){return false;};
//document.onkeydown=changeRow;
//不能屏蔽鼠标右键
//document.oncontextmenu=function(){return false;};
window.attachEvent("onload", function () {
	var testElement = document.getElementById("ScrollArea");
	if (testElement!=null)
	  initScrollTable(testElement);
});

⌨️ 快捷键说明

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