Yet another server side row add/client side refresh question

Yet another server side row add/client side refresh question

DavidTDavidT Posts: 1Questions: 0Answers: 0
edited June 2012 in DataTables 1.9
Hi all,

I've been happily digging around with DataTables for the last few days with a view to replacing widespread use of ASP gridviews wrapped in ASP UpdatePanels. This question is more along the lines of "is this the right way to do things" so no code yet.

I've configured DataTables with bServerSide = false, sAjaxSource = my ASP page handler and fnServerData defined. My dataset is typically less than 500 items and I wanted to use DataTables' column sorting, so that's why I set bServerSide false (as my server code was getting called each time I sorted a column). So far so good, everything works great. I also have a "new row" dialog which calls the same ASP page handler, successfully adds the row, and I get my callback function working properly in the browser.

What I can't get to work is a refresh of the table by calling fnDraw. Am I right in assuming this will only call fnServerData if bServerSide is true or rows have been added "by hand" on the client? I do understand that DataTables will only draw what it knows about and that a row added on the server won't magically appear on the client.

If I implement fnReloadAjax everything works fine - just want to know if this is the expected approach, given my configuration. I feel a better approach would be to return the new row data and add it to DataTables, but I don't know how it will affect the current sorting/page options the user might be using.

Thank you
David
This discussion has been closed.