How to refresh the current DataTable using the new data from server?

How to refresh the current DataTable using the new data from server?

espresso74espresso74 Posts: 11Questions: 0Answers: 0
edited February 2010 in General
Hi,
as the title, how could i achieve to refresh the datatable (for example, i delete one record from database,and then i click like 'refresh' button, it should refresh the datatable with the new data from database).

I tried to use fnReloadAjax/fnDraw/oTable.fnDeleteRow(rId, null, true), etc, still not working,
is there any easier way to utilize?

BTW, i currently use the Datatable pipeline with server side processing.

thanks
dave

Replies

  • allanallan Posts: 63,700Questions: 1Answers: 10,501 Site admin
    If you are using server-side processing with pipelining - then you need to clear the pipeline's cache, otherwise it will just read back what it already knows! There isn't a built-in way of doing this, but an easy way to add it would just be to use a global variable - check that to see if bNeedServer needs to be set to true.

    One other thing fnDeleteRow will not delete the row from the server-side. fnDelete row is client side only and won't send a signal to the server that it should delete the row from the database.

    Actually one more... fnReloadAjax should not be used with server-side processing (as noted in it's documentation) - just fnDraw will do it.

    Regards,
    Allan
  • espresso74espresso74 Posts: 11Questions: 0Answers: 0
    that sounds good.

    at least it make very clear as to what i should do rather than trying every mothed ineffectively. :-)

    thanks, allan for your amazing product.

    Dave
This discussion has been closed.