jquery - Adding a Second Custom Filter to datatables -
i using jquery datatables on rails application. add in second search box filter , use second filter fetch records using ajax. event trigger ajax functionality in datatables. achievable?
example:
html
<input class="search2"> </input> <table class="trackable"> <thead> <th> col 1 </th> <th> col 2 </th> </thead> <tbody> </tbody> </table>
js
$j = jquery.noconflict(); $j(document).on("ready", document, function(e) { var mytable = $j('table.trackable').datatable({ "blengthchange": true, "bfilter": true, "binfo": true, "bpaginate": false, "bautowidth": true, "deferrender": true, "sdom": 'it<"clear">flrtp', }); $j('input.search2').on('keyup', function(){ var extra_opts = { "bprocessing": true, "bserverside": true, "sajaxsource": "/recombinant_antibody/remote_fetch_projects", "fndrawcallback": function( osettings ) { alert('yes'); } } mytable.draw(extra_opts); }) });
Comments
Post a Comment