erich.wanker Posted July 25, 2013 Share Posted July 25, 2013 hello, has anyone a trick to close a showmodal-form by clicking beside the form ? like a popup .. if it is visible and i click somewhere - the popup will be closed.. i open the form per: tUniForm.ShowModal; thanks for suggestions :-) Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted July 25, 2013 Share Posted July 25, 2013 (1) Use show instead of showmodal OR (2) After showmodal you must use javascript and search a div element with class "x-mask" and add an onclick event there which closes the form. Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted August 1, 2013 Author Share Posted August 1, 2013 Hello, can anyone help me with the Suggestion of Oliver ? i search a piece of javascript and the step´s how to implement it to close a ShowModal Form by clicking on the "x-mask" div element ... Thank you Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted August 6, 2013 Author Share Posted August 6, 2013 push ;-) Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted August 7, 2013 Share Posted August 7, 2013 // UniForm1.script: function setMaskeventClosewindow(target) { var elements = document.body.getElementsByTagName('div'); for (var i = 0; i < elements.length; i++) { if (elements[i].className.indexOf('mask') != -1) { elements[i].onclick = function() {target.close();}; } } } // UniForm1.onShow: procedure TuniForm1.UniFormShow(Sender: TObject); begin UniSession.AddJS('setMaskeventClosewindow(' + self.WebForm.ExtWindow.JSName + ');'); end; // call in MainForm: UniForm1.ShowModal; Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted August 9, 2013 Author Share Posted August 9, 2013 Danke Oliver :-) works perfekt ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.