Avoid datatable reload on initialization
Avoid datatable reload on initialization
wfatherh
Posts: 2Questions: 0Answers: 0
Hello everyone
My page with datatable load twice - first time ordinary way, second (AJAX) triggered by datatable which means that my heavy server side reports run twice (a lot of time).
I'm trying to find some flag, properties etc. to avoid this behavior - no luck.
datatable is created by:
var dataTab=$('#tbl_rep').dataTable({
"bPaginate": false,
"bJQueryUI": true,
"aaSorting": [],
"bSortCellsTop": true
});
$('#tbl_rep') table already contains all data - no needs to trigger ajax request, also I don't need pagination in this case.
I will be very grateful for some hints.
Best regards,
Wojtek
My page with datatable load twice - first time ordinary way, second (AJAX) triggered by datatable which means that my heavy server side reports run twice (a lot of time).
I'm trying to find some flag, properties etc. to avoid this behavior - no luck.
datatable is created by:
var dataTab=$('#tbl_rep').dataTable({
"bPaginate": false,
"bJQueryUI": true,
"aaSorting": [],
"bSortCellsTop": true
});
$('#tbl_rep') table already contains all data - no needs to trigger ajax request, also I don't need pagination in this case.
I will be very grateful for some hints.
Best regards,
Wojtek
This discussion has been closed.
Replies
http://datatables.net/forums/discussion/17552/prevent-initial-datatables-load#Item_3
[code]"iDeferLoading": 0,[/code]
Allan
$('.dataTables_wrapper .ui-toolbar').css('background','url()');
I intended to remove header background (I know - stupid way), but I didn't realized that empty url means current url - so in fact I trigger reload page.
I'm sorry to waste your time and thank you for every response.
BTW datatable is awesome.
Best regards
Wojtek
I spend 2 days debugging something like that in an embedded environment once. Urgh!
Good to hear you got the issue resolved.
Allan