Web project Summary-Full paging component

Source: Internet
Author: User
Tags prev

Http://www.yeeoh.cn/newpk

Finally finished the project: framework design, page design, background design, interactive design, background code, front page code, foreground interaction code, database design, data entry, stress testing, fault tolerant testing, interactive testing, modification, patch, completely by one person to finish, in the middle of running business. I think it's a good idea.

Ajax technology was used in the front and back of the whole project. But looked at, and my home page than, a bit of pediatrics, but after all, is a commercial product site, do too loud, to play a bad role. Think about that year in the company, a Web project, back and forth, a large number of people joined, all the details are in place, Incredibly also made three months, finally became a tofu slag project, chilling AH.

Interested friends can talk about the value of this project geometry.

Because some people always think I can only cheat Ajax, oh, I can take out things like more than Ajax one bar ...

And someone actually said, give someone one months to learn Ajax, to keep him, but also some people, look at the recruitment information, I have no words. I'm a programmer, haha.

This project is not federated with other architectures, but the entire control process I feel like I'm getting some kind of perfection, after all, I believe that the use of this system of people, no one said too many impersonal words, I can think of the human basic all written in, and then the individual and the process of every detail has been at least three times, hey, I think this is the last time I've ever been in a life of technology, and these things, I guess I'll lose all of it. Because this thing makes me very sad, I think that personal things always tend to perfectionism, but those who do not understand the technology of the management staff but waste, incredibly and he said a word, on the stern retaliation, no wonder, 30 years Hedong, 30 years of Hexi, since you think that the technical life is cheap, and you think your management is outstanding, so good, I would like to, technically I dare to say that more than some people, so that I put down the technology, to start, even if the management I do not lose anyone.

I remember the beginning of the event is I said two words: rubbish. Good, I will still treat him as rubbish.

But again, I would like to emphasize that it is not my personal extreme, often one thing to solve, the wrong side of the apology, in fact, it is nothing, but before I received that apology, then this matter will not subside.

And the beginning of the beginning of the event, I can fully guarantee that it is strictly business, and definitely for the interests of the company.

Here's what I think is the most satisfying control in this project, the enhanced paging control.

Program code

//Paging control


//Parameters are: Rs object, each page shows the number of pages, page number point to the link, the current page number


function Pages (rsobj,pagesize,url,num) {


var pagecontent


rsobj.pagesize = PageSize


//If no page number is currently present, the default point to the first page


if (! $r (num) | | $r (num) = = "" | | $r (num). Count ==0 | | $r (num) <1) {


num = 1;


rsobj.absolutepage = 1;


//Otherwise point to the page number


}else{


num = number ($r (num) + "");


rsobj.absolutepage = num


   }


//Calculate total number of pages: Why not Rs.pagecount, because after the automatic adjustment of the display bar per page


//Otherwise the total number of page numbers will be calculated error


var PageCount = Math.ceil (rsobj.recordcount/pagesize)


pagecontent = Pagenum (rsobj,pagecount,url,num)


return "A total of" +pagecount+ "page/" +rsobj.recordcount+ "Record" +pagecontent


}


//Start calculating page number


function Pagenum (rsobj,pgcont,url,num) {


var cs,csl,csr,z,cont,thiscontent= "", maxpagenum=10


//When you limit the number of page numbers displayed each time, calculate the total number of page numbers


CS = Math.ceil (pgcont/maxpagenum)


//Calculates the maximum number of pages for the current group page


CSR = Math.ceil (num/maxpagenum)


//Calculates the minimum number of pages for the current group page


CSL = (CSR-1) *maxpagenum


//Current page number is the last group


if (CS = = CSR) {


//Because the last set of page numbers is not equal to the number of record bars left, do a fault-tolerant


if (Pgcont%maxpagenum = = 0) {


cont = Csl+maxpagenum


}else{


cont = csl+ (pgcont%maxpagenum)


     }


}else{


cont = Csr*maxpagenum


   }


//The current page is the last page, and the number of records is not equal to the number of records that are displayed by default, and the number of records is rewritten


if (num = pgcont && rsobj.recordcount%rsobj.pagesize!= 0) {


Rsobj.pagesize = Rsobj.recordcount%rsobj.pagesize


   }


CSL + 1


//Set home page, prev


if (num > 1) {


thiscontent + = Pgurl (url,1, "Home") +pgurl (URL, (num-1), "prev")


}else{


thiscontent = "<span> home </span><span> prev </span>"


   }


//Front/back Page group


////If the current page number is not the first group, show the link to the previous group of page numbers


if (CSR > 1) {


thiscontent + = Pgurl (URL, (csl-maxpagenum), "[...]")


}//else{


//Thiscontent + = "<span>[...] </span> "


   //}


//Looping through this group of page numbers


for (Z=CSL z<=cont; z++) {


thiscontent + + checkto (z,num,url)


   }


//If the current page number is not the first group, and the next group of page numbers is displayed, skip to the next group of page number links


if (CSR < CS) {


thiscontent + = Pgurl (URL, (cont+1), "[...]")


}//else{


//Thiscontent + = "<span>[...] </span> "


   //}


if (num!= pgcont) {


thiscontent + = Pgurl (URL, (num+1), "next page") +pgurl (Url,pgcont, "last")


}else{


thiscontent + = "<span> next </span><span> last </span>"


   }


return thiscontent


}


//Judge whether on this page or this group


function Checkto (pagesort,num,url) {


if (pagesort = num) {


return "<span class= ' default ' >[" +pagesort+ "]</span>"


}else{


return Pgurl (Url,pagesort, "[" +pagesort+ "]")


   }


}


//No links are given on this page or this group


function Pgurl (url,num,txt) {


return ' <a href= ' ' +url+ ' page= ' +num+ ' ' > ' +txt+ ' </a> '


}


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.