Sticky Pagination?
Sticky Pagination?
First, thank you for this AMAZING app. I cannot tell you how much time it has saved me...let alone server load! Fantastic!
I know next to nothing of .js. I am more of a .php guy. Within my DataTable, I have links. When a user exits the page and returns, they have to re-enter their search criteria into DataTables to return to where they were. Right now, I am getting around it using target="_blank" but would like to avoid this if possible. Is there some sort of cookie functionality that I am missing? If not, is there a way to do this?
The site I am working on is in beta at the moment and is available through invite only. Should you like to see it, it is at http://foursquareguru.com/foursquare-badge-list/. You will have to use code: DATATABLES.
Thanks for your time and help! Have a great day!
-thekruser
I know next to nothing of .js. I am more of a .php guy. Within my DataTable, I have links. When a user exits the page and returns, they have to re-enter their search criteria into DataTables to return to where they were. Right now, I am getting around it using target="_blank" but would like to avoid this if possible. Is there some sort of cookie functionality that I am missing? If not, is there a way to do this?
The site I am working on is in beta at the moment and is available through invite only. Should you like to see it, it is at http://foursquareguru.com/foursquare-badge-list/. You will have to use code: DATATABLES.
Thanks for your time and help! Have a great day!
-thekruser
This discussion has been closed.
Replies
Thank you for your reply! I can do the $_SESSION part, but have no idea how to go about loading the vars by JS. Any insight would be greatly appreciated.
I did find the following:
[url]http://datatables.net/ref#oSearch[/url]
and also
[url]http://stackoverflow.com/questions/11006402/initialize-search-input-in-jquery-datatables[/url]
So it looks like you could use some jQuery like this:
[code]
$(document).ready( function() {
var val = $('#hiddendata').val();
// check for empty string
if(val.length > 0){
$('#example').dataTable( {
"oSearch": {"sSearch": val}
} );
}
else{
$('#example').dataTable();
}
});
// or maybe even something like this:
$(document).ready( function() {
$('#example').dataTable( {
"oSearch": {"sSearch": $('#hiddendata').val()}
})
});
[/code]
or soemthing similar.
Thank you for taking the time to help me out. I will try incorporating this fix. You rock!!
Allan