Ticket #939 (closed New Feature: duplicate)
add toolbar buttons at runtime
| Reported by: | saul11 | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | UI : Toolbar | Version: | |
| Keywords: | Cc: |
Description
In the line of thought my request 'create toolbar(set) at runtime' (Ticket #937), it would be great to be able to add existing buttons at runtime.
Change History
comment:3 Changed 5 years ago by arczi
- Status changed from new to closed
- Resolution set to duplicate
DUP of #938
comment:4 Changed 5 years ago by arczi
- Status changed from closed to reopened
- Keywords Confirmed added
- Resolution duplicate deleted
I changed my opinion. Right now it is hard to hide button added to ToolbarSets in fckconfig.js
tbButton = new FCKToolbarButton( 'myButton', 'myButton', 'My button', FCK_TOOLBARITEM_ICONTEXT ) ) ;
tbButton.IconPath = icon;
FCKToolbarItems.RegisterItem( 'myButton', tbButton ) ;
if ( !IWantThisButton ) { //hack to hide myButton
tbButton.Create = function() {return 0;}
tbButton.Disable = function() {return 0;}
tbButton.RefreshState = function() {return 0;}
}
it should look like...
if ( IWantThisButton ) {
tbButton = new FCKToolbarButton( 'myButton', 'myButton', 'My button', FCK_TOOLBARITEM_ICONTEXT ) ) ;
}else{
tbButton = new FCKToolbarButton( 'myButton', 'myButton', 'My button', FCK_TOOLBARITEM_ICONTEXT | FCK_HIDDEN ) ) ;
}
and/or...
tbButton.setState('myButton', FCK_VISIBLE);
tbButton.setState('myButton', FCK_HIDDEN);
Note: See
TracTickets for help on using
tickets.
