Guest User

Untitled

a guest
Oct 3rd, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.90 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
  5.     <link rel="stylesheet" href="../../jqwidgets/styles/jqx.classic.css" type="text/css" />
  6.     <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script>  
  7.     <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
  8.     <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
  9.     <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
  10.     <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
  11.     <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
  12.     <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script>
  13.     <script type="text/javascript" src="../../jqwidgets/jqxgrid.filter.js"></script>       
  14.     <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script>  
  15.     <script type="text/javascript" src="../../jqwidgets/jqxlistbox.js"></script>   
  16.     <script type="text/javascript" src="../../jqwidgets/jqxdropdownlist.js"></script>  
  17.   <script type="text/javascript" src="../../jqwidgets/jqxcheckbox.js"></script>
  18.     <script type="text/javascript">
  19.         $(document).ready(function () {
  20.             // prepare the data
  21.             var theme = 'classic';
  22.      
  23.             var source =
  24.             {
  25.                  datatype: "json",
  26.                  datafields: [
  27.                      { name: 'ShippedDate', type: 'date'},
  28.                      { name: 'ShipName', type: 'string'},
  29.                      { name: 'ShipAddress', type: 'string'},
  30.                      { name: 'ShipCity', type: 'string'},
  31.                      { name: 'ShipCountry', type: 'string'}
  32.                 ],
  33.                 cache: false,
  34.                 url: 'data.php',
  35.                 filter: function()
  36.                 {
  37.                     // update the grid and send a request to the server.
  38.                     $("#jqxgrid").jqxGrid('updatebounddata', 'filter');
  39.                 }
  40.             };     
  41.            
  42.             var dataadapter = new $.jqx.dataAdapter(source, {
  43.                     loadError: function(xhr, status, error)
  44.                     {
  45.                         alert(error);
  46.                     }
  47.                 }
  48.             );
  49.            
  50.             // initialize jqxGrid
  51.             $("#jqxgrid").jqxGrid(
  52.             {      
  53.                 selectionmode: 'checkbox',
  54.                 source: dataadapter,
  55.                 theme: theme,
  56.                 filterable: true,
  57.                 columns: [
  58.                       { text: 'Shipped Date', datafield: 'ShippedDate', cellsformat: 'yyyy-MM-dd', width: 200 },
  59.                       { text: 'Ship Name', datafield: 'ShipName', width: 200 },
  60.                       { text: 'Address', datafield: 'ShipAddress', width: 180 },
  61.                       { text: 'City', datafield: 'ShipCity', width: 100 },
  62.                       { text: 'Country', datafield: 'ShipCountry', width: 140 }
  63.                   ]
  64.             });
  65.         });
  66.     </script>
  67. </head>
  68. <body class='default'>
  69.     <div id='jqxWidget'">
  70.         <div id="jqxgrid"></div>
  71.     </div>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment