Close child modal on INSERT

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
User avatar
jmcgov
Veteran Member
Posts: 79
Joined: 2018-12-19 01:31
Location: Northern Ireland

Close child modal on INSERT

Post by jmcgov » 2020-04-06 22:14

Hi,
When I add a new child record using the child modal from a parent record, I want
- the modal to close when the child record is inserted (I thik I use this "AppGini.closeParentModal()" from release 5.7", but how?)
- the s2 option box to be pre-populated with the new value
Any assistance, please?
James

User avatar
jmcgov
Veteran Member
Posts: 79
Joined: 2018-12-19 01:31
Location: Northern Ireland

Re: Close child modal on INSERT

Post by jmcgov » 2020-04-08 21:25

Progress
- enter the code below in the tablename-dv.js hook file, bingo!
- any thoughts on the second part, folks?

Code: Select all

$j(function(){
	if($j('input[name=Embedded]').val()==1){
		$j('form').submit(function(){
			//window.parent.jQuery('.modal').modal('hide');
			AppGini.closeParentModal(); 
		})
	}
})

Post Reply