Data rows not redrawn when calling fnDraw()

Data rows not redrawn when calling fnDraw()

ebbsyMKebbsyMK Posts: 3Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Hi,

Hoping someone can help as its driving me nuts!

I have used datatables quite a lot over the last few months and thought id had everything sorted but this latest page and the requirements just wont seem to work.

http://debug.datatables.net/axiwoq

As you'll see i have two tables on the page, the one that isnt working is #ProductList.
The table populates via ajax, this works ok, i can filter using the predefined filter box, again working fine. To enable some additional functionality i have got a drop down list with the choice of SSTId. This is passing back to the controller fine and I can use that to filter the data returned as json. This also works (confirmed ok with JsonLint and checking with Fiddler).

So what should happen is that the data returned after choosing that drop down and it calling fnDraw() is that the screen updates to show the new data, but thats the problem, it doesnt. The really weird thing though is that the debug for that table shows the rows with the right data but the actual page never updates (data rows, pagination, record numbers etc).

I'm guessing that something is failing but chrome doesnt show any js errors, nor does FF and it doesnt hit an ajax error (i had extra line for capturing the ajax error, that wasnt hit).

Any ideas? please! :) (cant post link to page, internal only and as its ajax loaded i cant use live either)

Tim

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Hi Tim,

    I'm afraid I'm not sure why this isn't working. A call to fnDraw with server-side processing should always refresh from the server. Are you seeing the Ajax request being made to the server?

    Allan
  • ebbsyMKebbsyMK Posts: 3Questions: 0Answers: 0
    Hi Allan, thanks for getting back to me. Yes I put a breakpoint on my data procedure so i know its getting the request and I can also see it in Fiddler (request and response).

    I'm pretty sure that the whole ajax call is working and returning fine (hence the data shown in the rows section of the debugger) its just the redraw itself that doesnt look to be occurring.

    I can post a screenshot of the page with the datatable displayed which would illustrate the difference in data shown on screen and what the debugger is reporting but im not sure that would help to solve the problem.

    Happy to include any code/html if that would help?

    Great product though by the way, standard implementation, ajax refresh its all been so useful so really wanted to say thanks for that

    Tim
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    To be honest, I suspect I'd need a link to a running test case to see what is happening. You could post the Javascript you are using and I'll see if I can see anything, but can't promise anything.

    Allan
  • ebbsyMKebbsyMK Posts: 3Questions: 0Answers: 0
    Thanks for the offer, i think ive got something sorted now, I had various complications with the dialog being loaded via ajax and having jscript in it. I've moved it out to the main page now and made sure its only run the once and it seems much happier and actually refreshes the table.

    So i can only assume it lost which table it should have been referencing or something, probably some sort of silent javascript failure although everything i looked at seemed fine.

    Cheers though
  • logeloge Posts: 15Questions: 1Answers: 0
    edited October 2013
    I have the same problem and i cant blame it on dialogs or something. I am 100% sure that the second AJAX call (triggered by fnDraw()) works fine and returns correct data but the GUI doesnt reflect the data. fnDrawCallback doesnt get called either after the fnDraw() call. Weird.

    More on that: http://82.113.152.82/forums/discussion/17733/fndraw-does-ajax-call-but-no-refresh-on-page#Item_1
This discussion has been closed.