when windows close

raimis

Member
i with element button in js call pop-up window, how can do something when window is closed.

Code:
if(windows close){
  run this code
}

here is my button code
JavaScript:
var url = 'index.php?option=com_fabrik&view=form&formid=17&Itemid=122&tmpl=component&ajax=1&noredirect=1&BookID='+IncomeParentID+'&RepeatParentID='+RepeatParentID;
Fabrik.getWindow({'id':'ServiceList', 'loadMethod': 'xhr', 'contentURL': ''+url+'', 'title': 'Service List', 'height':'50%', 'width':'50%',});
and for me need when close this window or save record, save form
 
Last edited:
found this
JavaScript:
Fabrik.addEvent('fabrik.list.row.edit.close', function (listRef, rowid, k){
..
}
but this only in list not in form
 
You should be able to provide an onClose function in the window opts ...

Code:
Fabrik.getWindow({
   'id':'ServiceList',
   'loadMethod':'xhr',
   'contentURL':''+url+'',
   'title':'Service List',
   'height':'50%',
   'width':'50%',
   'onClose': function(e, win) {
       // your code goes here
   }
});

-- hugh
 
Did you try it and put a breakpoint in the code so you can examine the variables?

e will be the event object, win will be the window object.

I think. But I'd have to try it and set a breakpoint in the code and look to make sure. I'm just going by a couple of examples of where we use an onClose callback in our code.

You probably won't need either, anyway.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top