valadi Posted July 28, 2015 Share Posted July 28, 2015 How change Height & Width Header mainmenu plz view Attach Files Quote Link to comment Share on other sites More sharing options...
bugra Posted July 29, 2015 Share 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 Link to comment Share on other sites More sharing options...
valadi Posted July 29, 2015 Author Share Posted July 29, 2015 thanks but not work code Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 30, 2015 Administrators Share Posted July 30, 2015 Menu height is a fixed value set by design and should not be changed. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted September 13, 2021 Share 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 Link to comment Share on other sites More sharing options...
Sherzod Posted September 13, 2021 Share 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 Link to comment Share on other sites More sharing options...
Abaksoft Posted September 13, 2021 Share 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 Link to comment Share on other sites More sharing options...
Abaksoft Posted September 14, 2021 Share 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 Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2021 Share Posted September 14, 2021 Hello, I will check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 14, 2021 Share 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 Link to comment Share on other sites More sharing options...
Abaksoft Posted September 15, 2021 Share 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 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.