Jump to content

unimForm OnActivate


x11

Recommended Posts

14 hours ago, dbf_usr said:

Да.

Здравствуйте,

Попробуйте этот код:

procedure TUniForm1.UniFormCreate(Sender: TObject);
begin
//создание события активации формы для отслеживания
   UniSession.AddJS(
    'if (uniVars._obs) {uniVars._obs.destroyObservable()};'+
    'uniVars._obs = Ext.mixin.Observable.observe(Ext.Container, {'+
    '    destroy: function() {'+
    '        if (arguments[0].uname == "window") {'+
    '            ajaxRequest('+ Self.WebForm.JSName +', "getActiveForm", ["activeForm="+Ext.WindowManager.getActive().owner.uname]);'+
    '        }'+
    '    }, show: function() {'+
    '        if (arguments[0].uname == "window") {'+
    '            ajaxRequest('+ Self.WebForm.JSName +', "getActiveForm", ["activeForm="+arguments[0].owner.uname]);'+
    '        }'+
    '    }'+
    '});'
   );

end;

 

Link to comment
Share on other sites

5 hours ago, Sherzod said:

UniSession.AddJS( 'if (uniVars._obs) {uniVars._obs.destroyObservable()};'+ 'uniVars._obs = Ext.mixin.Observable.observe(Ext.Container, {'+ ' destroy: function() {'+ ' if (arguments[0].uname == "window") {'+ ' ajaxRequest('+ Self.WebForm.JSName +', "getActiveForm", ["activeForm="+Ext.WindowManager.getActive().owner.uname]);'+ ' }'+ ' }, show: function() {'+ ' if (arguments[0].uname == "window") {'+ ' ajaxRequest('+ Self.WebForm.JSName +', "getActiveForm", ["activeForm="+arguments[0].owner.uname]);'+ ' }'+ ' }'+ '});' );

image.png.bdec94c0b6f6c88b851c8d0381f47927.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...