JS Common Order Code

Source: Internet
Author: User
Tags min

  For orders, we must be no stranger to it, under the introduction of the next use of JS to achieve the order, interested friends can refer to the next  

The code is as follows: <%@ page language= "java" contenttype= "text/html; Charset=utf-8 "  pageencoding=" Utf-8 "%>  <%  string path = Request.getcontextpath ();  string BasePath = Request.getscheme () + "://"   + request.getservername () + ":" + request.getserverport ()   + path + "/";  %>  <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" >  <html >  <head>  <title> Query system </title>  <link rel= "stylesheet" type= "Text/css"   href= "Http://www.jeasyui.com/easyui/themes/default/easyui.css" >  <link rel= "stylesheet" type= "Text/css" "  href=" http://www.jeasyui.com/easyui/themes/icon.css ">  <link rel=" stylesheet "type=" Text/css "   href= "Http://www.jeasyui.com/easyui/demo/demo.css" >  <script type= "text/javascript"   src= " Http://code.jquery.com/jquery-1.6.min.js "></script>  <script type=" Text/javascript "  Src= "Http://www.jeasyui.com/easyui/jquery.easyui.min.js" ></script>  <script type= "text/ JavaScript "  src=" Http://www.jeasyui.com/easyui/datagrid-detailview.js ></script>  <script src= "<%=basepath%>js/jquery.confirm.js" ></script>  <link rel= "stylesheet" href= "<%=" BasePath%>css/jquery.confirm.css ">    <style type=" text/css ">  form {  margin:0;   padding:0; }    dv-table TD {  border:0; }    dv-table input {  Borde r:1px solid #ccc; }  </style>  </head>  <body>  <table id= "DG" Title= " Booking decoration Management "class=" Easyui-datagrid "  style=" width:1200px; height:590px "url=" <%=basepath%>findsubsbypage.action "  toolbar=" #toolbar "pagination=" true "rownumbers = "true"   fitcolumns= "true" singleselect= "true" >  <thead>  <tr>  <th field= "Tel "Width=" > Contact Way </th>  <th field= "name" width= "> Contact </th>  <th field=" nametype "width=" > Decoration name </th >  <th field= "ordertime" width= "> Reservation time </th>  <th field=" content "width=" "> Notes </th>  <th field= "Sex" width= "> Sex </th>  <th field=" nowtime "width=" > Submission Time < /th>  <!--<th field= "status" Width= "ten" > Status </th>-->    </tr>  </ thead>  </table>  <div id= "toolbar" >  <div id= "toolbar" >  <a href= " Javascript:void (0) "class=" Easyui-linkbutton "iconcls=" Icon-remove "plain=" true "onclick=" Destroyuser () "> Delete order </a>  <a href= "javascript:void (0)" class= "Easyui-linkbutton" id= "Unorder" > Not sold orders </a> <a   href= "javascript:void (0)" class= "Easyui-linkbutton" id= "Order" > Sold orders </a> <a href= "javascript: void (0) "  class=" Easyui-linkbutton "id=" OK "> Deal </a>  </div> ;/div>  <table>  <tr>  <td colspan= "1" ></td>  </tr>  </ table>  <script type= "Text/javascript" >  $ (function () {  $ ("#unorder"). Click (function () {   var url = ". /findsubsbypage.action ";  $.post (URL, {  status:0 }, Function () {  $ (' #dg '). DataGrid (' reload '); nbsp ; });  $ ("#order"). Click (function () {  var url = ". /findsubsbypage.action ";  $.post (URL, {  status:1 }, Function () {  $ (' #dg '). DataGrid (' reload '); nbsp ; });  $ ("#ok"). Click (function () {  var url = ". /updatesub.action ";  var row = $ (' #dg '). DataGrid (' getselected ');  var elem = $ (this). Closest ('. Item ');  if (row!= null) {  $.confirm ({  ' title ': ' Operation confirmation prompt ',  ' message ': ' Are you sure you want to do this transaction? ',  ' buttons ': {  ' Yes ': {  ' class ': ' Blue ',  ' action ': function () {  elem.slideup ();  $.post (URL, {  id:row. Id }, Function () {  $ (' #dg '). DataGrid (' Reload '); }); }  ' No ':},  ' class ': ' Gray ',  ' action ': function () {   } } } }); } else {  alert ("You have not selected any information!");  } });  setinterval (function () {  $ (' #dg '). DataGrid (' Reload '); }, 60000); });  function Destroyuser () {  var row = $ (' #dg '). DataGrid (' getselected ');  if (row) {  $.messager.confirm (' Action prompt ',  ' Are you sure you want to delete this order? ',  function (r) {  if (r) {  $.post ('. /deletesub.action ', {  id:row.id }, Function (Result) {  if (result.success) {  $ (' #dg '). DataGrid (' Reload '); Reload the user data } else {  $.messager.show ({//Show error message  title: ' Error ',  msg:re sult.errormsg }); } }, ' json '); } }); }  </script>  < Script language= "JavaScript" >  function Myrefresh ()   {  window. Location.reload (); }  settimeout (' Myrefresh () ', 3000000); Specify 5 Seconds to refresh once   </script>  <style type= "text/css" >  #fm {  margin:0;  padding:10px 30px; }    ftitle {  font-size:14px;  font-weight:bold;  padding:5px 0;  Margin-bo ttom:10px;  border-bottom:1px solid #ccc; }    fitem {  margin-bottom:5px; -}  &NB SP;. Fitem label {  display:inline-block;  width:80px; }  </style>  </body>   </html>   
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.