Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a refresh button to jQuery Datatable

I have a dataTable in my application. I am required to add a Refresh button somewhere near Search textbox within the datatable in order to refresh the table when user clicks on it. I have figured out the refresh functionality.

The thing that I am stuck with is how do I include this button within the datatable? I want to access this button id in my end script.

Any suggestions? Also can anyone tell what is the use of bJQueryUI?

like image 709
SKR Avatar asked Jul 10 '12 13:07

SKR


2 Answers

I simply used the following code:

$('<button id="refresh">Refresh</button>').appendTo('div.dataTables_filter');
like image 180
SKR Avatar answered Nov 10 '22 06:11

SKR


Here is the example page for adding buttons from datatables.net

http://datatables.net/examples/advanced_init/dom_toolbar.html

And here is the example page for sDom as mentioned by @Mike: http://datatables.net/release-datatables/examples/advanced_init/dom_multiple_elements.html

like image 41
devlife Avatar answered Nov 10 '22 06:11

devlife