How to provide just the search box initially then load the Datatable records after user input data
How to provide just the search box initially then load the Datatable records after user input data
ria
Posts: 2Questions: 1Answers: 0
I am new to this plugin . I want to initially display the search box without datatable loading any records.
when the user inputs the data in search box the the DT should show up the with corresponding records. Is this possible ?
Thank you,
Ria
This discussion has been closed.
Answers
Does the data need to be sent from a server once the user inputs the search, or is all the data present when the page loads, and just hidden?
Hi Rhino,
Thank you for your response.The Data is present when the page loads. below is the script I am using for basic filtering and displaying of my data in DT.
$(document).ready(function() { var shilpatable = $('#example').dataTable( { "ajax": { "url": "jsondataset.txt", "dataSrc": "" }, "columns": [ { "data": "Name" }, { "data": "URL" }, { "data": "Views" }, { "data": "Type" } ], "aoColumnDefs": [ { "aTargets": [ 0 ], "mData": "Name", "width": "50%", "background-color":"white", "mRender": function (data, type, row) { return '' + row.Name + '';} }, { "targets": [ 2 ], "visible": false, "searchable": false }, { "targets": [ 1 ], "iDeferLoading": 840, "visible": false, "searchable": false } ], "iDisplayLength": 10, "oLanguage": { "sSearch": "Keyword " } } ); $("'#global_filter").on( 'keyup click', function () { filterGlobal(); } ); $("#tabs").tabs( { "activate": function(event, ui) { $( $.fn.dataTable.tables( true ) ).DataTable().columns.adjust(); } } ); $("ul.dropdownmenu").superfish({ autoArrows: false, speed: 'fast', delay: 0 }); } );Would something like this work for you? (demo)