一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

JS+Ajax+Jquery實現頁面無刷新分頁以及分組 超強的實現第1/2頁

復制代碼 代碼如下:
<%@ Page language="c#" Codebehind="GroupText.ASPx.cs" AutoEventWireup="false" Inherits="test1.GroupText" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
    <HEAD>
        <title>GroupText</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
        <LINK href="css/wmh.css" href="css/wmh.css" type="text/css" rel="stylesheet">
        <script src="js/jquery.js" type="text/Javascript"></script>
        <script src="js/Common.js" type="text/Javascript"></script>
        <script src="js/getCommonTable.js" type="text/Javascript"></script>
        <script src="js/GroupText.js" type="text/Javascript"></script>
        <script language="Javascript"><!--
        var ecid = '100001';
        var jpstr = "";
        var pageSize = 8;

        
// --></script>

    </HEAD>
    <body MS_POSITIONING="GridLayout">
        <form id="Form1" method="post" runat="server">
            <div class="listDiv" style="height:100%; PADDING-TOP: 2px">
                <table cellSpacing="0" cellPadding="0" width="100%" border="0">
                    <tr class="dg_header">
                        <td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; WIDTH: 10%; BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center" >活動名稱</td>
                        <td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; WIDTH: 10%; BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center">發送方</td>
                        <td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; WIDTH: 10%; BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center">接收方</td>
                        <td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; WIDTH: 12%; BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center">發送時間</td>
                        <td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; WIDTH: 38%; BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center">發送內容</td>
                        <td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; WIDTH: 10%; BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center">積分</td>
                        <td style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; WIDTH: 10%; BORDER-BOTTOM: 1px solid; TEXT-ALIGN: center">狀態</td>
                    </tr>
                    <tr>
                        <td class="dg_line" style="BORDER-BOTTOM: 0px solid" style="BORDER-BOTTOM: 0px solid" vAlign="top" width="100%" colSpan="7"
                            height="100%">
                            <div id="divcontent" style="WIDTH: 100%; HEIGHT: 100%" align="left"></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="dg_line" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid"
                            width="100%" colSpan="10">
                            <table width="100%">
                                <tr>
                                    <td class="pgtext">共<span id="recordcount" style="COLOR: red" style="COLOR: red">0</span>條記錄   
                                        目前第<span id="curpageindex" style="COLOR: red" style="COLOR: red">0</span> <font color="red">/</font><span id="pgcount" style="COLOR: red" style="COLOR: red">0</span>頁   
                                        <input class="pageText" id="gototxt" type="text" maxLength="10" name="gototxt" runat="server">
                                        <input id="gotopg" type="button" class="goBtn"></td>
                                    <td align="right"><IMG id="btnfirst" style="CURSOR: hand" style="CURSOR: hand" alt="首頁" src="Images/first.gif">
                                        <IMG id="btnpre" style="CURSOR: hand" style="CURSOR: hand" alt="" src="Images/btn_pre.gif" > <IMG id="btnnext" style="CURSOR: hand" style="CURSOR: hand" alt="" src="Images/btn_next.gif" >
                                        <IMG id="btnlast" style="CURSOR: hand" style="CURSOR: hand" alt="尾頁" src="Images/btn_last.gif" >
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </body>
</HTML>

Common.js
復制代碼 代碼如下:
Common.js:
//時間格式化

function getDateByFormat(oldDate){
                var Dy = oldDate.getFullYear();
                var Dm = oldDate.getMonth()+1;
                var Dd = oldDate.getDate();
                if(Dm<10){
                    Dm = "0" + Dm;
                }
                if(Dd<10){
                    Dd = "0" + Dd;
                }
                var newDate = Dy+'-'+Dm+'-'+Dd;

                    return newDate;
                }
//日期-時間格式化
function getDateTimeByFormat(oldDate){
                var Dy = oldDate.getFullYear();
                var Dm = oldDate.getMonth()+1;
                var Dd = oldDate.getDate();
                var Dh = oldDate.getHours();
                var Dmi = oldDate.getMinutes();  
                var Ds    = oldDate.getSeconds();   
                if(Dm<10)
                    Dm = "0" + Dm;
                if(Dd<10)
                    Dd = "0" + Dd;

                if(Dh<10)
                 Dh = "0" + Dh;
                if(Dmi<10)
                    Dmi = "0" + Dmi;
                if(Ds<10)
                    Ds = "0" + Ds;

                var newDate = Dy+'-'+Dm+'-'+Dd+' '+Dh+':'+Dmi+':'+Ds;
                    return newDate;
                }

//只能輸入數字
function txtnumber()
            {
                if ((event.keyCode >57) || (event.keyCode <48))
                    return false;else return true;
            }

        //只能輸入數字和字母

    function txtnumchar()
            { //65- 90 97-122
                var kcode = event.keyCode;
                if (kcode >= 48 && kcode <= 57)
                    return true;
                else if(kcode >= 65 && kcode <= 90)
                    return true;
                else if (kcode >= 97 && kcode <= 122)
                    return true;
                else
                    return false;
            }

getCommonTable.js
復制代碼 代碼如下:
getCommonTable.js
//獲取table頭
         function getTableHeadByWidth(widthSize,ids){
         var Tableone = "<table id='tab"+ids+"' border='0' cellspacing='0' cellpadding='0' ";
         var Tabletwo = ">";
         if (widthSize == "")
         return Tableone + Tabletwo;
         else
         return Tableone+"width="+widthSize+Tabletwo;

        }

        
//獲取第一個tr td 傳一個寬度值
        function getTrAndTdFirstByCWidth(classname,widthSize){
         var tdone = " <tr ";
         var tdtwo = "><td style="BORDER-BOTTOM: 1px solid;" style="BORDER-BOTTOM: 1px solid;" align='center' ";
         var tdthr = " > ";
         if (classname =="")
         tdone += tdtwo;
         else
         tdone+=" class ='"+classname+"' "+tdtwo;

         if (widthSize == "")
         tdone += tdthr;
         else
         tdone += " width="+widthSize+tdthr;

         return tdone;
        }

        //獲取下一個TD,傳一個寬度值
        function getTdNextByWidth(widthSize){
         var tdone = " </td><td style=" BORDER-BOTTOM: 1px solid" style=" BORDER-BOTTOM: 1px solid" align='center' ";
         var tdtwo =">";
         if (widthSize =="")
         return tdone+tdtwo;
         else
         return tdone+"width="+widthSize+tdtwo;
        }

        //獲取最后一個td
        function getTdLastByWidth(widthSize){
         var tdone = " </td><td style=" BORDER-BOTTOM: 1px solid" style=" BORDER-BOTTOM: 1px solid" align='center' ";
         var tdtwo =">";
         if (widthSize =="")
         return tdone+tdtwo;
         else
         return tdone+"width="+widthSize+tdtwo;
        }
        //獲取最后一個tr/td
        function getTrAndTdLast(){
         return " </td></tr>";
        }

        
        //獲取table尾
        function getTableLast(){
         return "</table>";
        }

        //獲取img
        function getImgByParams(imgUrl,altstr,eventName,eventParams,imgid){
         var one = "<img border='0' style="CURSOR: hand" style="CURSOR: hand"";
         if (imgUrl != "")
         one += "src='"+imgUrl+"'";
         if (altstr != "")
         one += "alt='"+altstr+"'";
         if(imgid != "")
         one += "id='"+imgid+"'";

         one += "onclick='"+eventName+"("+eventParams+");'> ";

         return one
        }

//--------排序---------------------------
            //通過字段的內容排序
        SortByBtnidAndCellName=function(btnId,cellName,celltype){
            var way =    getOpType(btnId);//0為正。1為倒
            var ds = userdata.value;
            var sortarr= new Array();
            if ((ds!= null) && (typeof(ds) == "object")){
             var len = ds.Rows.length;
             if(celltype=='S' || celltype=='N'){
                        for(var j=0;j<len;j++){
                            sortarr[j] = ds.Rows[j][cellName];//.substr(0,1);//通過字符
                            }
                    }else if(celltype=='D'){
                        for(var i=0;i<len;i++){
                                    sortarr[i] = getDateByFormat(ds.Rows[i][cellName]);//通過日期
                            }
                    }
                if(sortarr!=''){
                    var indexarr = new Array();
                    indexarr = getSortArray(sortarr,celltype);//得到新的排序規則
                    if(indexarr != ''){
                        setSortAginbyWay(indexarr,way);
                    }
                }
            }
        }

        //獲得排序
        getOpType=function(btnid){//返回0正序,1為倒序
            var imgName= $("#"+btnid).attr("src");
            var wz = imgName.indexOf('.gif');
            var oldImg =imgName.substr(wz-9,9);
            if(oldImg=='sort_desc'){//當前是倒序或未排序,需要正序sort_ascc
                $("#"+btnid).attr("src","../Images/sort_ascc.gif");
                return 0;
            }else{
                $("#"+btnid).attr("src","../Images/sort_desc.gif");
                return 1;
            }

        }
        //按JS Sort排序 獲得新的排序規則
        getSortArray=function (sortdatearr,celltype){// 參數為array
                var sortstr = '';
                for(var k=0;k<sortdatearr.length;k++){
                if(sortstr=='')
                        sortstr=sortdatearr[k];
                    else
                        sortstr+='^%^'+sortdatearr[k];
                }
                var newsortdate =sortdatearr;
                var len = sortdatearr.length;

                    if(celltype =='S' || celltype =='D')
                        newsortdate.sort();//字符排序
                    else{ //數字排序
                        for(var i=0;i<len;i++){
                            var tmp =0;
                            for(var j=i+1;j<len;j++){
                                if(newsortdate[i]>newsortdate[j]){
                                    tmp = newsortdate[i];
                                    newsortdate[i] = newsortdate[j];
                                    newsortdate[j] =tmp;
                                }
                            }
                        }
                    }

             var tmpsortdate =sortstr.split('^%^')

             var resultarr = new Array();
             for(var i = 0;i<len;i++){
                    for(var j = 0;j<len;j++){
                     if(newsortdate[i]==tmpsortdate[j]){
                            resultarr[i] = j;
                            tmpsortdate[j] ='||||||||';
                            break;
                     }
                    }
             }

             return resultarr;
        };

//--------------------end-------------------------------
//刪除重復的手機號碼
SplitRepeatMobile=function(mobile){
    var mob=mobile;
    for(var i=0;i<mob.length;i++){
        for(var j=i+1;j<mob.length;j++){
            if(mob[i]==mob[j]){
                mob.splice(j,1);
            }
        }
    }
    return mob;
}

JavaScript技術JS+Ajax+Jquery實現頁面無刷新分頁以及分組 超強的實現第1/2頁,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 激情影院a | 在线色网| 日韩中文字幕在线有码视频网 | 亚洲一区中文字幕在线观看 | 欧美成人免费一区在线播放 | 影院成人区精品一区二区婷婷丽春院影视 | 91逼逼| 色多多在线免费观看 | 久久精品国产清白在天天线 | 色 在线播放 | 伊人天伊人天天网综合视频 | 香蕉成人国产精品免费看网站 | 亚洲欧美视频一区二区三区 | 成人国产欧美精品一区二区 | 国产精品人人爱一区二区白浆 | 亚洲第一区在线观看 | 香蕉97超级碰碰碰碰碰久 | 69视频网| 日本人视频18jizz免费 | 9ⅰ视频在线播放 | 亚洲一区精品伊人久久伊人 | 伊人888| 久久久久久久成人午夜精品福利 | 91麻豆精品国产高清在线 | 2020国产精品 | 福利一区二区视频 | 手机看片自拍日韩日韩高清 | 国产美女福利在线 | 一本久道久综合久久鬼色 | 亚洲黄色小视频 | 国产精品视频观看 | 黑人美国一级一级爰片 | 加比勒精品视频在线观看 | 午夜在线免费视频 | 东京加勒比2021一区 | 91精品国产麻豆福利在线 | susu成人影院 | 免费激情视频网站 | 国产成人精品免费视 | 色老大综合久久综合热 | 免费真实播放国产乱子伦 |