dynamically modify ajaxSource
dynamically modify ajaxSource
good day guys!
i've a next question:
on my page i have dataTable, which was initialized with, for example, ajaxSource url like "/api/reports". when we're doing sorting, filtering it appends to url additional query-keys. I want do add keys date_from and date_to to AjaxSource url (date intervals could be changed after table initialization).
is there any entry-point function, before table reload, so i can do there smth like:
var oSettings = rtbl.fnSettings();
oSettings.sAjaxSource = "/api/reports/?type=sites&date_from=" + $("#date_from").text() + "&date_to=" + $("#date_to").text();
thanks for your help!
i've a next question:
on my page i have dataTable, which was initialized with, for example, ajaxSource url like "/api/reports". when we're doing sorting, filtering it appends to url additional query-keys. I want do add keys date_from and date_to to AjaxSource url (date intervals could be changed after table initialization).
is there any entry-point function, before table reload, so i can do there smth like:
var oSettings = rtbl.fnSettings();
oSettings.sAjaxSource = "/api/reports/?type=sites&date_from=" + $("#date_from").text() + "&date_to=" + $("#date_to").text();
thanks for your help!
This discussion has been closed.
Replies
[code]
$('.sorting').live('click', function(){
var oSettings = rtbl.fnSettings();
oSettings.sAjaxSource = "/api/reports/?type=sites&date_from=" + $("#date_from").val() + "&date_to=" + $("#date_to").val();
})
$('.sorting_asc').live('click', function(){
var oSettings = rtbl.fnSettings();
oSettings.sAjaxSource = "/api/reports/?type=sites&date_from=" + $("#date_from").val() + "&date_to=" + $("#date_to").val();
})
$('.sorting_desc').live('click', function(){
var oSettings = rtbl.fnSettings();
oSettings.sAjaxSource = "/api/reports/?type=sites&date_from=" + $("#date_from").val() + "&date_to=" + $("#date_to").val();
})
[/code]