当前位置:编程学习 > asp >>

客户端JS表格排序---摘自微软.

/**
*表格排序
*t:表格体.例:myTable.tBodies[0]
*iRowEnd:第几行停止排序.例:myTable.tBodies[0].rows.length-1
*fReverse:升序,降序.例:true(升)false(降)
*iColumn:第几列需要排序.例 4
*/
function insertionSort(t, iRowEnd, fReverse, iColumn)
{
    var iRowInsertRow, iRowWalkRow, current, insert;
    for ( iRowInsert = 0 + 1 ; iRowInsert <= iRowEnd ; iRowInsert++ )
    {
    if (iColumn)
    {
        if( typeof(t.children[iRowInsert].children[iColumn]) != "undefined")
        textRowInsert = t.children[iRowInsert].children[iColumn].innerText;
        else
        textRowInsert = "";
    }
    else
    {
        textRowInsert = t.children[iRowInsert].innerText;
    }
        
    for ( iRowWalk = 0; iRowWalk <= iRowInsert ; iRowWalk++ )
    {
        if (iColumn)
        {
        if(typeof(t.children[iRowWalk].children[iColumn]) != "undefined")
       textRowCurrent = t.children[iRowWalk].children[iColumn].innerText;
        else
       textRowCurrent = "";
        }
        else
        {
补充:asp教程,客户端相关打印 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,