Zui use case (ECLIPSE SMS project)

Source: Internet
Author: User

Insufficient: The export function is not written

HTML code:

<form action= "${basepath}/smsloglist.cwai" method= "Post" id= "Form1" >

。。。

<ul id= "Mypager" class= "pager" data-ride= "pager" data-rec-per-page= "${recperpage}" data-page= "${page}" Data-rec-total= "${total_count}" data-max-nav-count= "4" data-elements= "First_icon,prev_icon,nav,next_icon,last_ Icon,size_menu,goto,total_text "></ul>
<input type= "hidden" id= "page" name= "page" value= "" >
<input type= "hidden" id= "Recperpage" name= "Recperpage" value= "" >
<input type= "hidden" id= "Total_count" name= "Total_count" value= "" >

。。。

</form>

Note: page, refers to the page number, recperpage, refers to the number of data per page, Total_count, refers to the total number of data

jquery Code:

1  //page load to assign value2Window.onload =function Page_Init () {3$ ("#total_count"). Val ("${total_count}");4     } 5     6     //Zui Page Splitter7$ (' #myPager '). Pager ({8Menudirection: "Dropup",9 onpagechange:function (state, oldstate) {Ten             //alert (state.page+ "/" +oldstate.page); One             //alert (state.recperpage+ "/" +oldstate.recperpage); A             //When the page number or the number of items per page changes -             if((State.page! = oldstate.page) | | (Oldstate.recperpage! = state.recperpage)) && Oldstate.page! =void(0) && oldstate.recperpage! =void(0)) { -                         //Assign value to page number, item number per page the$ ("#PAGE"). Val (state.page); -$ ("#RECPERPAGE"). Val (state.recperpage); -var Mypager = $ (' #myPager '). Data (' Zui.pager '); -var page =parseint (state.page); +var recperpage =parseint (state.recperpage); -                 //Alert ("//"+page+"///"+recperpage"); +Mypager.set (page,NULL, recperpage); AConsole.log (' page number from ', Oldstate.page, ' changed to ', state.page); atDocument.forms[0].submit (); -             } -         }, -Elementcreator:function (element, $pager, state) {//The method of export (the method below can be put in xx.js, the export need to implement) -             if(element = = = ' Export_exel_button ')) { -                 return$ ("<input type=\" button\ "value=\" Export \ "Onclick=\" toexcel (); \ "Onblur=\" resetform (); \ "Class=\" btn\ ">"); in             } -             return false; to         } +});
Jscode

Java code:

1 //SMS List2@RequestMapping (value = "/smsloglist.cwai")3      PublicString smslogxq (Model model,string time,string total_count,httpservletrequest request)throwsIOException {4         //Get Parameters5String page = request.getparameter ("page");//Page Number6String recperpage = Request.getparameter ("Recperpage");//number of items per page7                 //Total is the parameter passed from the parent page8         if(Total_count = =NULL|| "". Equals (Total_count)) {9Total_count = Request.getparameter ("Total_count");Ten         } One         //Get current login user Information AHttpSession session=request.getsession (); -User loginuser= (user) Session.getattribute ("Loginuser")); -Bmuser user =Userservice.selectbyusername (Loginuser.getusername ()); theString userId =User.getuserid (); -          -                 //Set Default values -         if("". Equals (page) | | PAGE = =NULL){ +page = "1";//Show Home -Recperpage = "10";//10 items per page +         } A          atlist<map> dxmsgloglist = Dxmessageservice.selectdxmessagelogallbytimepager (UserId,PAGE,RECPERPAGE);//query by User ID, page number, number of items per page -Model.addattribute ("Dxmsgloglist", dxmsgloglist); -Model.addattribute ("Total_count", total_count); -Model.addattribute ("page", PAGE); -Model.addattribute ("Recperpage", recperpage); -         return"/home/smsloglist"; in}
Java Code

For the use and description of other properties, you can enter

ZUI-Open Source HTML5 cross-screen framework

To view, url:http://zui.sexy/#javascript/pagerjs

Zui use case (ECLIPSE SMS project)

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.