Jump to content

How change Height & WidthHeader mainmenu


valadi

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...