valadi Posted July 28, 2015 Posted July 28, 2015 How change Height & Width Header mainmenu plz view Attach Files Quote
bugra Posted July 29, 2015 Posted July 29, 2015 Hi you can add this code to UniFormShow UniSession.AddJS('document.getElementById("Your Menu's ID").style.height="40px";' ); but it may cause problems. UniMainMenu can overlap the others. Also you can change UniMainMenu's witdh by change height to width in this code but It cannot bigger than UniForm's width Quote
Administrators Farshad Mohajeri Posted July 30, 2015 Administrators Posted July 30, 2015 Menu height is a fixed value set by design and should not be changed. Quote
Abaksoft Posted September 13, 2021 Posted September 13, 2021 On 7/30/2015 at 7:38 AM, Farshad Mohajeri said: Menu height is a fixed value set by design and should not be changed. Hello Farshad, And how to hide MainMenu ? Example : if myUser = 'admin' then MainMenu.visible:= True else MainMenu.visible:=False (The purpose is to hide the top empty line) Thx Quote
Sherzod Posted September 13, 2021 Posted September 13, 2021 3 hours ago, Abaksoft said: And how to hide MainMenu ? Hello, Maybe something like this for now!? procedure TMainForm.UniFormCreate(Sender: TObject); begin with JSInterface do JSAddListener('afterrender', 'function(me){me.getRefItems().forEach(function(item){if (item.xtype && item.xtype=="toolbar"){item.hide()}})}', WebForm.JSWindow); end; 1 Quote
Abaksoft Posted September 13, 2021 Posted September 13, 2021 3 hours ago, Sherzod said: Hello, Maybe something like this for now!? procedure TMainForm.UniFormCreate(Sender: TObject); begin with JSInterface do JSAddListener('afterrender', 'function(me){me.getRefItems().forEach(function(item){if (item.xtype && item.xtype=="toolbar"){item.hide()}})}', WebForm.JSWindow); end; Thank you Sherzod, As usually you are our Maestro The code works as excpected. However I puted it on UniFormBeforeShow Event (MainForm) to control if fuser (from loginForm is admin then let it visible else hide it Thx again... 1 Quote
Abaksoft Posted September 14, 2021 Posted September 14, 2021 23 hours ago, Sherzod said: Hello, Maybe something like this for now!? procedure TMainForm.UniFormCreate(Sender: TObject); begin with JSInterface do JSAddListener('afterrender', 'function(me){me.getRefItems().forEach(function(item){if (item.xtype && item.xtype=="toolbar"){item.hide()}})}', WebForm.JSWindow); end; Hi Sherzod, The code is OK when Server > MainFormDisplayMode = mfWindow Not for mfPage . is it possible to get it for this mode (mfPage) ? MainForm = uniAlignmentClient Thx TopLine_MainMenu.7z Quote
Sherzod Posted September 14, 2021 Posted September 14, 2021 6 hours ago, Abaksoft said: is it possible to get it for this mode (mfPage) ? Hello, In this case, you need to use WebForm.JSForm: procedure TMainForm.UniFormCreate(Sender: TObject); begin with JSInterface do JSAddListener('afterrender', 'function(me){me.getRefItems().forEach(function(item){if (item.xtype && item.xtype=="toolbar"){item.hide()}})}', WebForm.JSForm); end; Quote
Abaksoft Posted September 15, 2021 Posted September 15, 2021 14 hours ago, Sherzod said: Hello, In this case, you need to use WebForm.JSForm: procedure TMainForm.UniFormCreate(Sender: TObject); begin with JSInterface do JSAddListener('afterrender', 'function(me){me.getRefItems().forEach(function(item){if (item.xtype && item.xtype=="toolbar"){item.hide()}})}', WebForm.JSForm); end; Great Many Thx Quote
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.