Ajax Submission Form: Initializing a list of records with Ajax query results form

Source: Internet
Author: User
Tags query client

It is also convenient to initialize a record list form using the list<map> array, with an example of Ajax queries and pagination.
Pagination Control Pageobj initialization parameter {uid: "", List: ""} is required, the remainder can use default values.
One, the effect chart

Second, the client page file newslistform.html
<!--
Initialize the record list form with Ajax query results
Client code
Hu Enlightened
2011-11-21
-->
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<title> Call Ajax query Implementation records list form initialization </title>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<script type= "Text/javascript" src= "Res/js/pvo.js" ></script>
<script type= "Text/javascript" src= "res/js/jbxx.jsp" ></script>
<script type= "Text/javascript" src= "Res/js/page.js" ></script>
<script type= "Text/javascript" src= "Res/jquery/jquery-1.4.2.min.js" ></script>
<script type= "Text/javascript" >
var record={id: "Qicity", S: "", DEFAULTLM: "<option value=" Enterprise Bulletin > Enterprise Announcement </option><option value= "Enterprise Information" > Enterprise Information </option> "};
function Querynews () {
var action=pvo.getroot () + "/exservlet?method=queryqynews";/the action of the query request, as the action in the form;
Pvo.query (Action, function () {
var p=new pageobj ({//Create a paging object
UID: "browsetd",//Specifies a container for display results
numperpage:6,//the number of records displayed per page numperone:10,//each group of pages
List:pvo. result//This is the query result//BARTYPE:0//2: Indicates that the index bar is displayed on the upper and lower sides of the query result, 0, only the index bar is displayed above the query result, 1, the index bar is displayed only below the query result;
});
P.f=function () {//Implementing user methods
var list = p.pagelist;//The record of the current page from the result of the paging
var uid=p.bodyid;//gets the DOM element ID of the principal part from the paging board
document.getElementById (UID). innerhtml= ""; This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20121116/33897.html

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.