1. #1
    Ext JS Premium Member
    Join Date
    Aug 2011
    Location
    Sweden
    Posts
    31
    Answers
    2
    Vote Rating
    0
    Dannesart is on a distinguished road

      0  

    Default Unanswered: disable button if selected row not got any value on specific column

    Unanswered: disable button if selected row not got any value on specific column


    Hi is it possible to disable a button if a spefic row aint got no value?
    disabled.PNG
    If the column "Bekräfta" got a value, then the button "Bekräfta" in the dropdown should be "Not disabled"

    Code for disable all the buttons if no rows are selected:
    Code:
    setDisabledOnMessagingButtons: function(disabled) {
            this.sendSmsButton.setDisabled(disabled);
            this.sendEmailButton.setDisabled(disabled);
            this.sendPortalInfoButton.setDisabled(disabled);
            this.confirmButton.setDisabled(disabled)
        },
    
        onGridSelectionChange: function(model, selected, options) {
            
                this.setDisabledOnMessagingButtons(model.getCount() < 1)
            
        },
    Attached Images

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,207
    Answers
    3517
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    How are you inserting the button? Is it an Action column or is it put in using a renderer or....?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Aug 2011
    Location
    Sweden
    Posts
    31
    Answers
    2
    Vote Rating
    0
    Dannesart is on a distinguished road

      0  

    Default


    It's in a menu,
    Extend: 'Ext.menu.Menu',

    Code:
    Ext.define('Intelliplan.Modules.Staffing.Consultant.sendPicker.MenuUi', {
        extend: 'Intelliplan.Base.Menu.Standard',
        initComponent: function() {
            Ext.apply(this, function() {
    
            });
            this.callParent(arguments);
        },
        defineItems: function(){
            var menu = [
    
                  {
                    xtype: 'button',
                    text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendSmsButton.Text'),
                    tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendSmsButton.Tooltip'),
                    itemId: 'sendSmsButton',
                    disabled: true,
                    cls: 'split-button communicationDropdownMenu confirmShiftsButton',
                    iconCls: 'silk-phone'
    
                },
                {
                    xtype: 'button',
                    text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendEmailButton.Text'),
                    tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendEmailButton.Tooltip'),
                    itemId: 'sendEmailButton',
                    disabled: true,
                    cls: 'split-button communicationDropdownMenu confirmShiftsButton',
                    iconCls: 'silk-email'
                },
                {
                    xtype: 'button',
                    text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Text'),
                    tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Tooltip'),
                    itemId: 'sendPortalInfoButton',
                   disabled: true,
                    cls: 'split-button communicationDropdownMenu confirmShiftsButton',
                    iconCls: 'icon-portal-email'
                },
                {
                    xtype: 'button',
                    text: 'Bekräfta',
                   // text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Text'),
                    tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Tooltip'),
                    itemId: 'confirmButton',
                   disabled: true,
                    cls: 'split-button communicationDropdownMenu confirmShiftsButton',
                    iconCls: 'silk-accept'
                }
            ]
            return menu;
        }
    });

Thread Participants: 1