xxxpilot Posted February 18, 2017 Share Posted February 18, 2017 Hey there. I have a form full of dynamically loaded frames with tons of objects on it.. The question is - HOW can I create a TUniButton, what can stay on top of all other objects having fixed coordinates (relatively to web browser window)? I tried to create the Button using standard method,setting main form as a Parent, and using BringToFront method, but the frame created before stays on top in any case.. Thanks in advance Quote Link to comment Share on other sites More sharing options...
erich.wanker Posted February 18, 2017 Share Posted February 18, 2017 ClientEvent -> ExtEvent -> function afterrender(sender, eOpts) { sender.getEl().setStyle('z-index','90100'); } :-) Quote Link to comment Share on other sites More sharing options...
xxxpilot Posted February 19, 2017 Author Share Posted February 19, 2017 I've modified a bit this event: function afterrender(sender, eOpts){ sender.getEl().setStyle("position", "fixed"); sender.getEl().setStyle("left", "5px"); sender.getEl().setStyle("top", "5px"); sender.getEl().setStyle("z-index", 9999); } But because button's parent form has AlignmentControl->Client and Layout->Fit, the button now covers all the display view Any idea on how to override this behaviour? Meanwhile I set the main form Layout to absolute, and in OnScreenResize event put the code to control the dimensions of main container what is a Parent for all other elements (except the button). What is the corerct way changing CSS style of object injecting JS? I tried without success (var_FBtnMenu - name of TUniButton): self.var_FBtnMenu.JSInterface.JSConfig('style', [self.var_FBtnMenu.JSControl.JSObject('opacity: 0.3')]); Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2017 Share Posted February 25, 2017 Hi, If your question is still valid, make a test case, we will try to analyze. Best regards. Quote Link to comment Share on other sites More sharing options...
xxxpilot Posted February 27, 2017 Author Share Posted February 27, 2017 I finally found a solution. Instead of using JSInterface.JSConfig, what never gave me a positive result in the code: self.var_FBtnMenu.JSInterface.JSConfig('style', [self.var_FBtnMenu.JSControl.JSObject('opacity: 0.3')]) I tried next code and got opacity of object at UI to required value: UniSession.AddJS('document.getElementById("'+self.var_FBtnMenu.JSControl.Id+'").style.opacity="0.3";'); Below how it looks having some additional events coded: UniSession.AddJS('document.getElementById("'+self.var_FBtnTestMe.JSControl.Id+'").style.opacity="0.3";'); self.var_FBtnTestMe.ClientEvents.ExtEvents.Values['afterrender']:= 'function (sender, eOpts) {'+ 'sender.getEl().setStyle("position", "fixed");'+ 'sender.getEl().setStyle("left", "3px");'+ 'sender.getEl().setStyle("top", "3px");'+ 'sender.getEl().setStyle("z-index", 9999);}'; self.var_FBtnTestMe.ClientEvents.ExtEvents.Values['mouseout']:= 'function (sender, e, eOpts){sender.getEl().setStyle("opacity", 0.3);}'; self.var_FBtnTestMe.ClientEvents.ExtEvents.Values['mouseover']:= 'function (sender, e, eOpts){sender.getEl().setStyle("opacity", 1);}'; If you have any suggestions in regards of above code optimization, I would be grateful to check 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.