Assign ID to Global Search Box
Assign ID to Global Search Box
jkalla
Posts: 6Questions: 2Answers: 0
Description of problem: I'm trying to figure out how to assign an ID to the global search box, either in the javascript or on the page html. I found an answer for using Selenium, but not something that allows me to change it in the script. Here's what I have for script at this time:
$(document).ready( function () {
$('#myTable').DataTable({
language: {
search: "Filter records: "
},
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
bLengthChange:true,
bInfo:true,
bPaginate:true,
order: [[2, "desc"]],
search: {
return: false
}
});
} );
This question has accepted answers - jump to:
Answers
Add this to your table initialisation object:
Out of interest, why do you need to do this?
Allan
What I'm actually trying to do is send a URL to the page with
?searchID=mytext
at the end of it. If there's an easy way to do this, I can't figure it out. I was hoping to pre-search the table on the page.Unfortunately, I have no idea what a 'table initialisation object' is. Sry. The code is just included in the page.
Sounds like you want to use the Deep linking plugin.
That is the code in lines 3-16 in your above code snippet. Its a Javascript object passed to the
$('#myTable').DataTable( )
function call.Kevin
Thanks, @kthorngren! I was able to get it to work using deep linking. Now I just have to figure out how to stop initializing the table twice.
If you show us your code, we should be able to help with that.
Allan
Doh. I've just seen your other thread on that topic and that Kevin has already replied!
Allan