PHP on Form closing ?

Incremental

Member
Hi,
I would like to execute some PHP when closing my Ajax form (to refresh my List)
I tried F3.1 PHP Process script : After the End of the Form (getEndContent) but it is executed at the End of the Form Load.

Would it be possible to execute code when clicking on the window Closing Cross ?
Capture.PNG
 
Mainly, I would like to refresh my List, as the Ajax done when I delete a row

I would really appreciate help on this topic...
 
I don't think that's possible. PHP form plugins are run when the form is processed - I don't know what window you have open but closing it won't process a form.
Can you give more details about where this window is and what you expect to happen when its closed?
 
Thanks for your answer.
When I click Edit or View on my List , an ajax "popups" opens the Form.
This form process a PHP script onLoad() which changes a hidden status field.
Thus, even if I close or save the Form, returning to the List, the Status field is modified.

BUT when returning to my List which displays the Status, there is no refresh of the change.
I would like to force this List refresh to see the updated status (like when deleting a List row).

A way to refresh could be to reload the page, but I don't know how to force it.
If it's not possible with PHP, could it be done with some Javascript at the Form closing ?
 
Thanks for the explication, that makes sense to me.
So in github (https://github.com/Fabrik/fabrik/commit/2be721fe94c008e13dbaa3590cf9615eb5d93259) I've added some new JavaScript events that are triggered when these windows are closed. You should be able to hook into them in a custom.js file (e.g. /components/com_fabrik/js/list_X.js) where X is your list id, with the following code:

JavaScript:
/**
* Ensure that Fabrik's loaded
*/
 
requirejs(['fab/fabrik'], function () {
 
  // An edit window has been closed
  Fabrik.addEvent('fabrik.list.row.edit.close', function (listRef, rowid, k) {
 
    // Update the lists data
    Fabrik.getBlock(listRef).updateRows();
  });
});
 
Great !
It's exaclty what I want ! :D

PS : do I have to understand that listRef does'nt need to be initialised (ie : list_4) ?
 
Correct. In this case, it's an argument being passed in by the code that triggers the fabrik.list.row.edit.close event.

-- hugh


 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top