dynamically modify ajaxSource

dynamically modify ajaxSource

psihonavtpsihonavt Posts: 4Questions: 0Answers: 0
edited March 2010 in General
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!

Replies

  • psihonavtpsihonavt Posts: 4Questions: 0Answers: 0
    edited March 2010
    i solved it this dummy way :)

    [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]
This discussion has been closed.