Results 1 to 3 of 3

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

  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2011
    Location
    Sweden
    Posts
    31
    Answers
    2
    Vote Rating
    0
      0  

    Default 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 "Bekrfta" got a value, then the button "Bekrfta" 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 Attached Images

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,422
    Answers
    3901
    Vote Rating
    1271
      0  

    Default

    How are you inserting the button? Is it an Action column or is it put in using a renderer or....?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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
      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: 'Bekrfta',
                   // 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;
        }
    });

Posting Permissions

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