Multiple tables on one page - Reload second table on first table edit

Multiple tables on one page - Reload second table on first table edit

webpointzwebpointz Posts: 126Questions: 30Answers: 4

I have two datatables on one page. The first table shows ACTIVE products. The second table shows INACTIVE products.

If I deactivate a product in the first table doing an EDITOR update, it no longer shows the product in the first table BUT it doesn't show the inactive product in the second table.

How do I ensure the first table edit reloads the second table?

This question has accepted answers - jump to:

Answers

  • webpointzwebpointz Posts: 126Questions: 30Answers: 4
    Answer ✓

    Got it myself.

    I added the following to the JS:

        editor.on( 'postSubmit', function ( e, type ) {
            $('#table_products2').DataTable().ajax.reload();
        } );
    
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Spot on - thanks for posting back.

    Allan

This discussion has been closed.