DataTables logo DataTables

via Ad Packs
Datatables + fancybox - Reload on specific conditons?
  • dittoditto
    Posts: 6
    I am loading data into datatables from a DB via AJAX. There are bunch of columns and it's not possible to view them all at the same time in any sane way. So In one of my columns I have a link that opens an iframe (with tabbed content) to view or edit the full record. For that I'm using fancybox. What I'd like to do is have datatables reload *only* if I update the record (hit an update button in the iframe). Via the fancybox onclose function I was able to cause a reload everytime the iframe is closed but I don't see a way to pass a variable to it to say only refresh if update=true. Maybe I can do something on the datatables side?

    Before I went off and spent a lot of time lot of time researching this and trying to figure it out on my own I was wondering if anyone might have some ideas to point me in th right direction and help save me some time?
  • allanallan
    Posts: 15,505
    Sounds reasonable - are you planning on reloading the whole table (i.e. the fnReloadAjax plug-in) or just a given row (i.e. the fnUpdate API method)? Either way, can you just put an 'if' condition around the reload to check if it should be done or not?

    Allan
  • dittoditto
    Posts: 6
    Ah.. fantastic!

    fnReloadAjax was exactly what I needed. I created a function to call from an onsubmit on my iframe that closes francybox then calls it. Super fast! Much better than reloading the whole page.

    Thanks for the help. I love datatables.
This discussion has been closed.
← All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Support

Get useful and friendly help straight from the source.

In this Discussion