Results 1 to 4 of 4

Thread: Setting a buttin disabled or enabled

  1. #1

    Default Setting a buttin disabled or enabled

    Hello all,
    I have a Panel listing some emails, when the user selects a row, i have to enable a menu, when there's no selections, the menu shall remain disabled, here's my code:
        var topBar = [
            text: 'Actions',
            id: 'actionsMenu',
            disabled: true,
            menu: [actionMarkAsRead, actionMarkAsUnread, actionDelete]
        'Search: ', 
        ' ',
                store: store,
                width: 180,
                hasSearch: true
        var selectModel = new Ext.grid.CheckboxSelectionModel({
            listeners: {
                selectionchange: function() {
                    if(selectModel.getCount() > 0) {
                        Ext.getCmp('actionsMenu').disabled = false;
                    else {
                        Ext.getCmp('actionsMenu').disabled = true;
    As you can see, i have no idea how to set that set of buttons to disabled and enabled ...
    anyone can help me ?

  2. #2


    Generally when you want to perform an action on a particular object, you should look for methods rather than properties. Button shows it has enable() and disable() methods in the API docs.

  3. #3


    thank you.
    I didnt know it was a Button object since it's a simple array.

  4. #4
    Ext User
    Join Date
    Jul 2007


    That's a little confusing because at the end of your prior post you say "button"?

    Maybe this is where you needed to look?

    Creates a new Toolbar

    config : Object/Array
    A config object or an array of buttons to add

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts