MVC's Ajax paging query data __ajax

Source: Internet
Author: User
<span style= "FONT-SIZE:18PX;"
            >//Paging Control $ (document). Ready (function () {var pageSize = 10;
            var index; Paging Control $.jqpaginator (' #pagination2 ', {pagesize:pagesize, totalcounts:10,// Total number of visiblepages:10, Currentpage:1, prev: ' <li class= ' prev ' ><a href= "javascript:;" > Prev </a></li> ', Next: ' <li class= ' next ' ><a href= ' javascript:; > Next </a></li> ', page: ' <li class= page ' ><a href= javascript:;
                    >{{page}}</a></li> ', onpagechange:function (num, type) {index = num;
                GetData ();

            }
            }); function GetData () {$.post ("@Url. Action (" Selectbookstudent ")", {"PageSize": pageSize
                    , "PageIndex": Index,"Type": "@ (request.querystring[" type "]??"
                    False ")"}, function (result) {var html = '; if (result = NULL | | result.list.length > 0) {$ (' #pagination2 '). Jqpaginator (' option ', {total
                        Counts:result.total});
                        Total = Result.list.length; $.each (result.list, function (I, item) {//Time format conversion var pa =/.*\ (.
                            *)\)/; var startdate = Item. Tkbegindate.match (PA) [1].substring (0, 10); Convert start time format var enddate = Item. Tkenddate.match (PA) [1].substring (0, 10);//conversion termination time format var tkstartdate = GetTime (startdate); Start date var tkenddate = GetTime (EndDate); End date var tktestdate = tkstartdate.substring (0, 10); Intercept date var tkbegintime = tkstartdate.substring (11, 19); Intercept start time var tkendtime = tkenddate.substring (11, 19);//End time HTML
                            + "<tr>";
                            HTML + + "<td>" + (i + 1) + "</td>"; HTML + + "<td>" + item.
                            Placetest + "</td>";
                            HTML + + "<td>" + tktestdate + "</td>";
                            HTML + + "<td>" + tkbegintime + "</td>";
                            HTML + + "<td>" + tkendtime + "</td>"; HTML + + "<td>" + item.
                            Regnumtotal + "</td>"; HTML + + "<td>" + item.
                            Regnum + "</td>"; HTML + + "<td>" + item.
                            Explain + "</td>"; html = "<td><a href= ' javascript:void () ' onclick= ' Tkbook (\" "+ Item.) Tkcode + "\", "+ Item".
                            Type + ") ' > Appointment </a></td>"; html = "</tr>";
                        });
                        $ (". Table-list tbody"). HTML (HTML);
                        $ ("#select_tableList tbody"). HTML (HTML);
                        $ ("#select_tableList tbody tr"). Click (function () {$ (this). Toggleclass ("Curr");});
                    $ (". Table-list tbody TR"). Click (function () {$ (this). Toggleclass ("Curr");});

}
                })
            }
        });   //Time conversion         function getTime (/** timestamp=0 **/) {&NBSP;&NBSP;&NB sp;         var ts = arguments[0] | |
0;
            var t, y, M, D, H, I, S;             t = ts?
New Date (TS * 1000): new Date ();
            y = t.getfullyear ();             m= T.getmonth () + 1;
            d = t.getdate ();
            h = t.gethours ();
            i = t.getminutes ();
            s = t.getseconds ();            //can be defined here according to the time format                return y + '-' + (M < 10? ' 0 ' + m:m) + '-' + (D < 10? ' 0 ' + d:d) + ' + (H < 10? ' 0 ' + h:h) + ': ' + (I < 10? ' 0 ' + i:i) + ': ' + (S < 10?
' 0 ' + s:s);        } </span>


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.