Cool General page Display Control (v) Add, delete, modify records, category settings (part Ii.)

Source: Internet
Author: User
Tags modify query
Pagination | control | Show < three > and record display related client code:

Increased control in the Listrecordscon.inc


<script language= "JavaScript" >

var pagenum = <%=theCurrentPageNum%>;

Trigger When you click the Select All records on this page check box
function Checkall (form)
{
for (Var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name!= ' chkall ' && e.name!= ' chkallpage ')
e.checked = form.chkall.checked;
}
}

Trigger When you click the Select All records for this class check box
function Checkallpage (form)
{
for (Var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name!= ' chkallpage ')
e.checked = form.chkallpage.checked;
}
}

Check to see if a record is selected
function checkbox (Form)
{
var thelength;
var i,j;

Thelength = Form.chk.length;
i = 0;
j = 0;

while (I<thelength) {
if (form.chk[i].checked)
j + +;
i + +;
}

if (j==0 &&!form.chk.checked) {
Alert ("Please select Record First");
return false;
}
return true;
}

triggered when you click the Delete button
Function del (form)
{
var ClassID;

if (!checkbox (form)) {
return false;
}
Else
If confirm (' Are you sure you want to delete these records? ')){
<% if Thequeryclass <> "" Then%>
ClassID in the For_query form in Query.inc
ClassID = "classid=" +document.form_query.classid.value;
<% Else%>
ClassID = "";
<% End If%>
Theactionscript the suppressed field, generated when the Listrecords () function is invoked
Form.action = Form.theActionScript.value + "_delete.asp" +CLASSID;
Form.submit ();
}
}

var Openwin_add;
var init = "<%=theInit%>";

triggered when you click the Add button
function Add (PN)
{
<% if Thequeryclass <> "" Then%>
ClassID in the For_query form in Query.inc
Auto Select current category
ClassID = "&classid=" +document.form_query.classid.value;
<% Else%>
ClassID = "";
<% End If%>
window.open (' <%=theactionscript%>_edit.asp?pn= ' +pagenum+classid+ ' <%=theTableClassStr%> ' +init, ', ' Width=<%=thewinw%>,height=<%=thewinh%>,resizable=0,scrollbars=yes ');

}

var Openwin_edit;
function edit (ID,PN)
{
window.open (' <%=theactionscript%>_edit.asp?id= ' +id+ ' &pn= ' +pagenum+ ' <%=theTableClassStr%> ', ', ' Width=<%=thewinw%>,height=<%=thewinh%>,resizable=0,scrollbars=yes ');
}

var Openwin_view;
function View (ID,PN)
{
window.open (' <%=theactionscript%>_view.asp?id= ' +id+ ' &pn= ' +pagenum+ ' <%=theTableClassStr%> ', ', ' width=<%=thewinw%>,height=<%=thewinh+12%>,resizable=0,scrollbars=



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.