1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    3
    Vote Rating
    0
    Rayanagouda is on a distinguished road

      0  

    Default Unanswered: Issue with Confirm message box

    Unanswered: Issue with Confirm message box


    Hi ,

    I am not getting how to make code text field disabled in confirm in add and edit mode

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,112
    Answers
    678
    Vote Rating
    470
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    See if this is what you are looking for:

    Code:
    var form = Ext.create('Ext.form.Panel', {
        title: 'Simple Form',
        bodyPadding: 5,
        width: 350,
    
        // Fields will be arranged vertically, stretched to full width
        layout: 'anchor',
        defaults: {
            anchor: '100%'
        },
    
        tbar: [
            {
                text: 'Disable',
                handler: function(){
                    Ext.Msg.confirm('Disable field', 'Are you sure?', function (button) {
                        if (button == 'yes') {
                            form.down('#firstname').setDisabled(true); 
                        }
                    });
                    
                }
            }        
        ],
        
        // The fields
        defaultType: 'textfield',
        items: [{
            fieldLabel: 'First Name',
            itemId: 'firstname',
            name: 'first',
            allowBlank: false
        },{
            fieldLabel: 'Last Name',
            name: 'last',
            allowBlank: false
        }],
    
        renderTo: Ext.getBody()
    });
    Scott.

Thread Participants: 1