It is currently 21 April 2025, 16:19 Advanced search

Tool Bars

Questions and answers on how to best use Instant Developer

Tool Bars

Postby Ted Giles » 22 July 2021, 11:51

The requirement is for a different Toolbar for either of 2 forms.
The standard one will be fine for form A, but form B needs restrictions - not just disabling Add New Record, but not showing it at all in the toolbar.
I have read the manual but cannot see where to put the code to remove just some of the items in the toolbar.
Say I want to disable the ADD button. How would I do that?
Do I need to create a new Toolbar from scratch, or can I adapt the existing one with a Command Set? (And I am unclear on that also).

Could someone point me in the right direction please?
User avatar
Ted Giles
 
Posts: 590
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK

Re: Tool Bars

Postby d.termini » 22 July 2021, 11:58

You could use the setCommandEnabled() function of the Panel library.
For example yourpanel.setCommandEnabled(Insert, false) should be enough to remove the "+" button from the toolbar. At least with the Zen theme, I don't know if it works fine with Bootstrap.
d.termini
 
Posts: 1638
Joined: 13 November 2017, 8:41

Re: Tool Bars

Postby Ted Giles » 22 July 2021, 15:54

Still struggling with where to put the code. The Star for insert still appears on the Toolbar and is operational.
Please see below. Should I create a Command Set?

InDe01.png
InDe01.png (103 KiB) Viewed 2304 times
User avatar
Ted Giles
 
Posts: 590
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK

Re: Tool Bars

Postby d.termini » 22 July 2021, 15:57

I think it works only in the OnLoad event, some of these functions are a bit tricky, the documentation should tell you where to use it
d.termini
 
Posts: 1638
Joined: 13 November 2017, 8:41

Re: Tool Bars

Postby Ted Giles » 22 July 2021, 17:23

I am going over the 28 hours of training videos looking for stuff.
The OnLoad event sounds promising.
Thanks.
User avatar
Ted Giles
 
Posts: 590
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK

Re: Tool Bars

Postby Ted Giles » 23 July 2021, 11:38

InDe1.jpg
InDe1.jpg (58.75 KiB) Viewed 2272 times

Yep, OnLoad event is the place for it. I can put all of the controls I need into that process. Many thanks.
A lot of the control is actually in the form set up, but the user wants the toolbar items to be removed, and at this point, they are changing their views regularly.
User avatar
Ted Giles
 
Posts: 590
Joined: 29 November 2013, 12:58
Location: The Wolds, Lincolnshire, UK


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 23 guests