Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function() {
- $("#detailReport").DataTable({
- "sDom": 'W<"clear">lfrtip',
- "bJQueryUI" : true,
- "bRetrieve" : true,
- "bFilter" : true, //Search Option
- "bLengthChange" : true, //Show count per page
- "bInfo" : true, //Total no of entries
- "bPaginate" : true, //Next Previous button
- initComplete: function () {
- this.api().columns('.select-filter').every( function () {
- var column = this;
- var select = $('<select id="defectSelectSearch"><option value="">All</option></select>')
- .appendTo( $("#typeFilter"))
- .on( 'change', function () {
- var val = $.fn.dataTable.util.escapeRegex(
- $(this).val()
- );
- column
- .search( val ? '^'+val+'$' : '', true, false )
- .draw();
- } );
- column.data().unique().sort().each( function ( d, j ) {
- if(d == '${selectedType}')
- select.append( '<option value="'+d+'" selected="selected">'+d+'</option>' );
- else
- select.append( '<option value="'+d+'">'+d+'</option>' );
- } );
- } );
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement