Dejo
Dejo

Reputation: 2148

How to set Ext.button.Split not to show arrow when menu is empty?

I have Ext.button.Split, for example:

Ext.create('Ext.button.Split', {
    renderTo: Ext.getBody(),
    text: 'Example',
    handler: function() {
        alert("Click!");
    }
});

Right now it does not have any menu items. I want to set the button not to show arrow if there are no items. How ? I use EXTJS 4.1 version.

Upvotes: 1

Views: 3978

Answers (2)

Wes Grant
Wes Grant

Reputation: 889

I had a similar issue with ExtJS 6.0.1.

Once the splitbutton is rendered (at least into some panels like an action widget in a grid column), simply setting the property:

button.arrowVisible = false; 

...will not work. You must do this:

button.setConfig('arrowVisible', false); 

Upvotes: 2

Krzysztof
Krzysztof

Reputation: 16140

You can set split: false to hide arrow. You can also use Ext.button.Button instead of Ext.button.Split - when menu is assigned, arrow shows.

Example: http://jsfiddle.net/AUE6J/

Upvotes: 4

Related Questions