<!DOCTYPE html>
<html>
    <head>
    <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.12.1/sb-1.3.4/datatables.min.css"/>
 
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.12.1/sb-1.3.4/datatables.min.js"></script>
        <meta charset=utf-8 />
        <title>DataTables - JS Bin</title>
    </head>
    <body>
        <div class="container">
          <button>Get SearchBuilder details</button>
            <table id="example" class="display" width="100%">
                <thead>
                    <tr>
                        <th>Name</th>
                        <th>Position</th>
                        <th>Office</th>
                        <th>Age</th>
                        <th>Start date</th>
                        <th>Salary</th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <th>Name</th>
                        <th>Position</th>
                        <th>Office</th>
                        <th>Age</th>
                        <th>Start date</th>
                        <th>Salary</th>
                    </tr>
                </tfoot>
            </table>
        </div>
    </body>
</html>
 
body {
    font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #fff;
}
div.container {
    min-width: 980px;
    margin: 0 auto;
}
 
// Server-side processing with object sourced data
$(document).ready(function() {
  $('#example').dataTable( {
    dom: 'Qfrtip',
    "processing": true,
    "serverSide": true,
    "ajax": {
      "url": "/ssp/post.php",
      "type": "POST",
//       "data": function(d) {
//         var dt = $('#myTable').DataTable();
//         var sbDetails = JSON.stringify(dt.searchBuilder.getDetails());
//         d.sbCrit = sbDetails;
//         return JSON.stringify(d);
//       }
    },
    "columns": [
      { "data": "first_name" },
      { "data": "last_name" },
      { "data": "position" },
      { "data": "office" },
      { "data": "start_date" },
      { "data": "salary" }
    ]
  } );
  
  $('button').on('click', function () {
    var dt = $('#myTable').DataTable();
    console.log(dt.searchBuilder.getDetails());
  });
  
} );
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers