call back outside of the function
call back outside of the function
naveenkumarpg
Posts: 1Questions: 0Answers: 0
Hi all
This is my problem :-
i want to trigger couple of lines of code after the
$("#sometable").dataTable( .......); has called
i dont have scope to change the code in the plugin either in Js files (the are external sources)
and the tables are not available at the load after selecting some options the table will get render
what i need is
1) i need a selector of the table (like #sometable at top, these selectors are generic i don't have common classes for the tables)
2) i need to call another function after this datatable() has triggered
what is the scope to find these things, is there any binding or call back are available outside of the initialization of data tables
Please help
Thanks in advance
Naveen
This is my problem :-
i want to trigger couple of lines of code after the
$("#sometable").dataTable( .......); has called
i dont have scope to change the code in the plugin either in Js files (the are external sources)
and the tables are not available at the load after selecting some options the table will get render
what i need is
1) i need a selector of the table (like #sometable at top, these selectors are generic i don't have common classes for the tables)
2) i need to call another function after this datatable() has triggered
what is the scope to find these things, is there any binding or call back are available outside of the initialization of data tables
Please help
Thanks in advance
Naveen
This discussion has been closed.
Replies
As advanced examples suggest, you can initialize you DataTables like that :
[code]var oTable = $("#sometable").dataTable( .......);[/code]
So you still have a reference to your table you can use after initialization.
Moreover, you may find custom events useful : http://datatables.net/release-datatables/examples/advanced_init/dt_events.html
Regards,
Thibault
For example, you could do:
[code]
$('#example').bind('init', function () {
...
} );
[/code]
Then the function will be executed when the DataTable is fully initialised.
Allan