how to call back to server using fnReloadAjax

how to call back to server using fnReloadAjax

bubuzzzbubuzzz Posts: 26Questions: 0Answers: 0
edited August 2011 in General
Hi all,

I have 2 datatables in one page. The first one contains all the user data and the secone one contains the products belonging to a particular user. When i press a row of the table 1, table 2 will automatically refresh and retrieve the new data of the pressed user in the table 1. I tried to use fnReloadAJax but it is not successful coz the post back url does not automatically include all the necessary params like sEcho, sDisplayStart... Can anyone tell me whether fnReloadAjax is correct in this situation or do i have to use sth else ?

Replies

  • bubuzzzbubuzzz Posts: 26Questions: 0Answers: 0
    I had a solution, which is re defining the second table with the new Ajax source but i think this solution is very terrible
  • bubuzzzbubuzzz Posts: 26Questions: 0Answers: 0
    Successfully reload the dataset by setting back the sAjaxSource of the table 2 and use fnDraw () to redraw it. not sure whether it is the optimal solution or not

    [code]
    $("#table1 tbody tr td .showProducts").bind('click',function(event){
    oTable2.fnSettings().sAjaxSource = this.href;
    oTable2.fnDraw ();
    };

    [/code]
  • bubuzzzbubuzzz Posts: 26Questions: 0Answers: 0
    I got another problem here as well now. How can i set the bProcessing from false to true after the page is loaded ? Since in the beginning, table 2 doesn't not have any data source, I have to set bProcessing and bServerSide to false. Now how can i set it back ?
  • bubuzzzbubuzzz Posts: 26Questions: 0Answers: 0
    hmm ...

    [code]
    oTable2.fnSettings().sAjaxSource = this.href;
    [/code]

    does not work with IE 9.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    > Can anyone tell me whether fnReloadAjax is correct in this situation or do i have to use sth else ?

    Its not - no :-). As the documentation note for fnReloadAjax notes, if you are using server-side processing, you need to just call fnDraw() - however, to modify the source address, you need to do something like your server post - which looks just about perfect to me.

    Regarding the IE9 issue, can you alert what this.href is? Perhaps you need a this.getAttribute('href')?

    Allan
  • bubuzzzbubuzzz Posts: 26Questions: 0Answers: 0
    The IE9 issue is my mistake. Thank allan for your support. Have a nice weekend everyone, and happy birthday to FREDDIE MERCURY :)
This discussion has been closed.