📄 accounting.aspx
字号:
</table>
<TABLE class="botline" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
<TR>
<td align="center" style="height: 25px"><asp:Button ID="btnSerch" CssClass="button" Width="101px" Text="搜索" runat="server" OnClick="btnSerch_Click"/>
<input class="button" id="showAdvanceSearchButton" onclick="showAdvancedSearchLayer(this, 2)"
type="button" value="显示高级搜索>>>" style="width: 121px">
</td>
</TR>
</TABLE>
<script language="javascript">
function showAdvancedSearchLayer(theElement, startRow) {
var isShow = theElement.value == '显示高级搜索>>>'
var searchTable = document.all('advancedSearchTable');
var rows = searchTable.rows;
for (i = startRow; i < rows.length; i++) {
searchTable.rows(i).style.display = isShow ? 'inline' : 'none';
}
theElement.value = isShow ? '隐藏高级搜索<<<' : '显示高级搜索>>>';
}function t3_onclick() {
}
</script>
<!--搜索 end-->
</TD>
<TD width=1 bgColor=#add7fd></TD></TR></TBODY></TABLE>
</div>--%>
</form>
<script language="javascript" type="text/javascript">
function resetcolor()
{
var obj=document.getElementById("MyBodyTab");
for(var i = 0; i <obj.rows.length; i++)
{
obj.rows(i).style.background = (i%2)? "#ffffff" : "#efefef";
}
}
function rowover(obj) {
if (obj.style.background == "#BEDFFE")
return;
obj.style.background = "#BEDFFE";
}
function rowout(obj) {
if (obj.style.background == "#BEDFFE")
return;
obj.style.background = (obj.sectionRowIndex % 2) ? "#e6eff8" : "#e6eff8";
obj.style.color = "#000000";
}
function rowclick(obj) {
for (var i = 0; i < document.getElementById("MyBodyTab").rows.length; i++)
{
with(document.getElementById("MyBodyTab").rows(i))
{
if (style.background == "#bfdfff")
{
style.background = (i % 2) ? "#ffffff" : "#efefef";
style.color = "#000000";
break;
}
}
}
obj.style.background = "#bfdfff";
obj.style.color = "#ffffff";
}
function HeadScroll()
{
document.getElementById("THead").scrollLeft = document.getElementById("TBody").scrollLeft;
}
function ChangWidth()
{
var e = event.srcElement;
if (e == undefined)
return;
if (e.tagName != "TD")
return;
var H = document.getElementById("MyHeadTab");
var B = document.getElementById("MyBodyTab");
var CellIndex;
for (var i = 0; i <H.rows(0).cells.length; i++)
if (H.rows(0).cells[i] == e)
{
CellIndex = i;
break;
}
var l = e.offsetLeft + 70;
if (e.style.cursor == "e-resize") //是改变列宽
{
e.setCapture();
document.onmousemove = function ()
{
if (e == undefined)
return;
e.style.cursor = "e-resize";
var w = event.x + document.getElementById("THead").scrollLeft - l;
if (w >= 5)
{
e.style.width = w;
if (B.rows.length < 1)
return;
B.rows(0).cells[CellIndex].style.width = w;
if(typeof(Y) != "undefined")
clearTimeout(Y);
if (B.rows.length < 50) //防止排序有问题
Y = setTimeout("ChangWidthx("+ CellIndex +")" , 100);
else
Y = setTimeout("ChangWidthx("+ CellIndex +")" , 800);
}
HeadScroll();
}
document.onmouseup = function ()
{
if (e == undefined)
return;
e.releaseCapture();
e = undefined;
}
}
else
{
//排序
if (event.button == 1)
TdSort(CellIndex);
}
}
function ChangWidthx(CellIndex)
{
var B = document.getElementById("MyBodyTab");
var H = document.getElementById("MyHeadTab");
var w = document.getElementById("MyHeadTab").rows(0).cells[CellIndex].style.width;
for (var i = 0; i < B.rows.length; i++)
B.rows(i).cells[CellIndex].style.width = w;
B.rows(0).cells[B.rows(0).cells.length-1].style.width = 0;
if (B.offsetWidth < B.parentNode.parentNode.offsetWidth)
{
B.rows(0).cells[B.rows(0).cells.length-1].style.width = B.parentNode.parentNode.offsetWidth - B.offsetWidth + 20;
}
HeadScroll();
}
function ChangCursor()
{
var e = event.srcElement;
if (e.tagName != "TD")
return;
var x = event.x + document.getElementById("THead").scrollLeft; //此值在固定表头时要更改
var l = e.offsetLeft-10;//此处可修改
if (x >= l + e.offsetWidth + 8)
e.style.cursor = "e-resize";
else
e.style.cursor = "default";
}
function TdSort(CellIndex)
{
var Text = "↑";
var S = 1; //向上排
var H = document.getElementById("MyHeadTab");
var This = H.rows(0).cells[CellIndex];
if (CellIndex==0 || This.innerText =="")
return; //没有数据或序号列,不排序
if (This.innerText.indexOf("↑") != -1)
{
Text = "↓";
S = 0;//向下排
}
for (var i = 0; i < H.rows(0).cells.length; i++)
{
var Ttitle = H.rows(0).cells[i];
if (Ttitle.innerText.indexOf("↑") != -1 || Ttitle.innerText.indexOf("↓") != -1)
{
Ttitle.innerText = Ttitle.innerText.substring(0 , Ttitle.innerText.length - 2);
break;
}
}
This.innerText += " "+ Text;
TSort(CellIndex , This.oType , S); //开始排序
}
function TSort(CellIndex , oType , Type)
{
var Temp = document.getElementById("MyBodyTab").tBodies[0].rows;
var A = new Array();
for (var i = 0; i < Temp.length; i++)
A[i] = Temp[i];
A.sort(SortSub(CellIndex , oType , Type));
for (var i = 0; i < A.length; i++)
document.getElementById("MyBodyTab").tBodies[0].appendChild(A[i]);
}
function parseStr(s)
{
return String(s).toUpperCase();
}
function parseDate(s)
{
return Date.parse(s.replace(/\-/g, '/'));
}
function SortSub(CellIndex , oType , Type)
{
var ThisType = String;
if (oType == "Num")
ThisType = Number;
else if (oType == "Date")
ThisType = parseDate;
else if (oType == "Str")
ThisType = parseStr;
return function (x,y)
{
if (ThisType(x.cells[CellIndex].innerText) > ThisType(y.cells[CellIndex].innerText))
return Type ? 1 : -1;
if (ThisType(x.cells[CellIndex].innerText) < ThisType(y.cells[CellIndex].innerText))
return Type ? -1 : 1;
return 0;
};
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -