Wordpress Plugin
Wordpress Plugin
I'm going to just be completely honest with all of you. I don't know anything about datatables. I was lead here from use of the wordpress plugin WP-Tables reloaded, which uses datatables. It wouldn't do exactly as I wanted, and the creator told me it may be possible with a custom datatable. I have no clue how to create or implement one, but I thought I'd ask anyway.
I need the table to be hidden until after it is filtered. Something like this:
http://www.filtermart.com/fpdbdb/fmccross.asp
Then after you search have something like this?
http://www.filtermart.com/fpdbdb/result.asp
Again, way over my head so sorry if I'm asking a dumb question.
I need the table to be hidden until after it is filtered. Something like this:
http://www.filtermart.com/fpdbdb/fmccross.asp
Then after you search have something like this?
http://www.filtermart.com/fpdbdb/result.asp
Again, way over my head so sorry if I'm asking a dumb question.
This discussion has been closed.
Replies
Allan
[code]
$(document).ready(function() {
$('#example').dataTable();
} );
[/code]
For the table generation - can you create the table without a filter? If so, how are you doing it?
Allan
http://stilwellok.us/s/
My boss is insisting that the table not be shown until after something is searched for.
As for the initialization code...I don't know what to do with it. Like I said, I don't understand DataTables.
Once that is done, all you need to do is run the code I gave you above and you'll get your DataTable :-)
Allan
I don't have an HTML table. My table is created with WP_Table Reloaded, a Wordpress plugin.
The links you give are simply one page submitting a form, then generating a table based on that form and that's that. The only thing you would need to do on top of that is initialise DataTables.
I don't know what initialize means.
I'm not certain how WP-TableReloaded works, with regard to loading the information into the table. Does it just read it from HTML? A way to tell this would be to disable Javascript in your browser and then look at your page - if you can see the unenhanced table - then it is there. How is the table HTML being put into the document at the moment?
Allan
Here is my table in question:
http://stilwellok.us/s/
The table shows up without the extras when Javascript is turned off. You said that means it reads from the HTML right?
PS: Sorry if I sounded testy early. I'm trying to create a website for a family business. The owners, my dad and his brothers, are convinced that I can figure out how to do it no problem just because of what generation I am and wont believe me when I tell them I don't know anything about computers. It's been frustrating.
http://stilwellok.us/search/
What do I do next?
Add a listener to your form submit button, and make it call the data initialization table.
[code]
$('#dataform').submit( function() {
display_table();
....
}
function display_table() {
/* datatables initialization goes here */
}
[/code]
Hth,
Gerardo
[code]
var oTable;
if (oTable) {
oTable.fnReloadAjax();
} else {
oTable = $('#table').dataTable( {
..................
}
[/code]
Allan
I've created an HTML table. Is there some code I can add to it t make it filter using the search page I created here:
http://stilwellok.us/13375-2/
and if so, what do I do with it.
[code]
@import "/datatables/media/css/demo_table.css";
$(document).ready(function() {
$('#example').dataTable();
} );
[/code]
Allan