Jump to content

How change Height & WidthHeader mainmenu


valadi
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • 6 years later...
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

Link to comment
Share on other sites

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;

 

  • Like 1
Link to comment
Share on other sites

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...

 

  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;

 

Link to comment
Share on other sites

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

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.

 Share

×
×
  • Create New...