abstractindia

Html - Datatables

Dec 25th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.33 KB | None | 0 0
  1. <div class="row">
  2.                     <div id="" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
  3.                        
  4.                       <table id="employee_grid" class="display table-bordered table-striped table-hover" width="100%" cellspacing="0">
  5.         <thead>
  6.             <tr>
  7.                 <th class="col-lg-2 col-md-2 col-sm-2 col-xs-2">Student Name</th>
  8.                 <th class="col-lg-1 col-md-1 col-sm-1 col-xs-1">Gender</th>
  9.                 <th class="col-lg-1 col-md-1 col-sm-1 col-xs-1">City</th>
  10.                 <th class="col-lg-3 col-md-3 col-sm-3 col-xs-3">Course Description</th>
  11.                 <th class="col-lg-2 col-md-2 col-sm-2 col-xs-2">Subject</th>
  12.                 <th class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right">Scholarship</th>
  13.                 <th class="col-lg-2 col-md-2 col-sm-2 col-xs-2">View Details</th>
  14.             </tr>
  15.         </thead>
  16.  
  17.         <tfoot>
  18.            
  19.                <tr>
  20.                
  21.                 <th class="col-lg-2 col-md-2 col-sm-2 col-xs-2">Student Name</th>
  22.                 <th class="col-lg-1 col-md-1 col-sm-1 col-xs-1">Gender</th>
  23.                 <th class="col-lg-1 col-md-1 col-sm-1 col-xs-1">City</th>
  24.                 <th class="col-lg-3 col-md-3 col-sm-3 col-xs-3">Course Description</th>
  25.                 <th class="col-lg-2 col-md-2 col-sm-2 col-xs-2">Subject</th>
  26.                 <th class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right">Scholarship</th>
  27.                 <th class="col-lg-2 col-md-2 col-sm-2 col-xs-2">View Details</th>
  28.             </tr>
  29.                
  30.            
  31.         </tfoot>
  32.     </table>
  33.                    
  34.                   </div>
  35.                 </div>
  36.                
  37.                 <!-- InstanceEndEditable -->
  38.             </div>
  39.         </div>
  40.  
  41. <script>
  42. $( document ).ready(function() {
  43. $('#employee_grid').DataTable({
  44.          "bProcessing": true,
  45.          "serverSide": true,
  46.          "autoWidth": true,
  47.          "stateSave": true,
  48.          "lengthMenu": [ 10, 25, 50, 100 ],
  49.          "ajax":{
  50.           url :"response_b.php", // json datasource
  51.           type: "post",  // type of method,GET/POST/DELETE
  52.           error: function(){
  53.           $("#employee_grid_processing").css("display","none");
  54.             }
  55.           },
  56.     "columnDefs": [ {
  57.     "targets": 6,
  58.     "data": "StudentID",
  59.     "render": function ( data, type, full, meta ) {
  60.       return '<a href="beneficiary.php?StudentID="'+data+'">'+data+'</a>';
  61.     }
  62.   } ]
  63.         });  
  64. });
  65.    
  66.   </script>
Add Comment
Please, Sign In to add comment