Results 1 to 5 of 5

Thread: Disabled Checkbox can still be checked/unchecked when on iPad

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    45
    Answers
    4
    Vote Rating
    3
      0  

    Default Answered: Disabled Checkbox can still be checked/unchecked when on iPad

    My sencha checkboxes are unchangeable in Chrome after disabling them, however, on the iPad they are still changeable.

    Is this normal? Is there a workaround to make them actually disabled in iPad rather than just greyed out?

  2. this is what i ended up doing... bit awkward but it works... also have the functionality of clicking the label to check/uncheck
    Code:
                    listeners:
                    {
                        check:function(){
                            var obj = Ext.getCmp('[cmp id]');
                            if(!obj.isDisabled()){
                                filterObjs(obj.getId(), obj.getValue(), obj.isChecked());
                            }
                        },
                        uncheck:function(){
                            var obj = Ext.getCmp('[cmp id]');
                            if(!obj.isDisabled()){
                                filterObjs(obj.getId(), obj.getValue(), obj.isChecked());
                            }
                        },
                        click: {
                            element: 'el',
                            fn: function() {
                                var obj = Ext.getCmp('[cmp id]');
                                if(obj.isDisabled()){
                                    if(obj.isChecked()){
                                        obj.uncheck();
                                    } else {
                                        obj.check();
                                    }
                                }
                            }
                        },
                        labelEl:{
                            tap:function(){
                                var obj = Ext.getCmp('[cmp id]');
                                    if(obj.isChecked()){
                                        obj.uncheck();
                                    } else {
                                        obj.check();
                                    }
                            }
                        }
                    }

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      0  

    Default

    So the check event doesn't fire but yeah the checkmark does change colors. There isn't a way I found to stop it but since the value doesn't change you can simply use a CSS to not sure the check changing:

    Code:
    .x-field.x-item-disabled .x-input-radio:checked:after,
    .x-field.x-item-disabled .x-input-checkbox:checked:after {
        border-color: #DDD;
    }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  4. #3
    Sencha User
    Join Date
    Sep 2011
    Posts
    45
    Answers
    4
    Vote Rating
    3
      0  

    Default

    i have a function on 'change' listener that does get fired when the button is disabled

  5. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    45
    Answers
    4
    Vote Rating
    3
      0  

    Default

    okay the check/uncheck events wont fire...however with your method, if a user checks the box while it is disabled.. it wont appear checked... but then if the checkbox is enabled again it will appear checked even though the system still thinks it is unchecked (the check event never fired because the user never checked it while it was enabled)

  6. #5
    Sencha User
    Join Date
    Sep 2011
    Posts
    45
    Answers
    4
    Vote Rating
    3
      0  

    Default

    this is what i ended up doing... bit awkward but it works... also have the functionality of clicking the label to check/uncheck
    Code:
                    listeners:
                    {
                        check:function(){
                            var obj = Ext.getCmp('[cmp id]');
                            if(!obj.isDisabled()){
                                filterObjs(obj.getId(), obj.getValue(), obj.isChecked());
                            }
                        },
                        uncheck:function(){
                            var obj = Ext.getCmp('[cmp id]');
                            if(!obj.isDisabled()){
                                filterObjs(obj.getId(), obj.getValue(), obj.isChecked());
                            }
                        },
                        click: {
                            element: 'el',
                            fn: function() {
                                var obj = Ext.getCmp('[cmp id]');
                                if(obj.isDisabled()){
                                    if(obj.isChecked()){
                                        obj.uncheck();
                                    } else {
                                        obj.check();
                                    }
                                }
                            }
                        },
                        labelEl:{
                            tap:function(){
                                var obj = Ext.getCmp('[cmp id]');
                                    if(obj.isChecked()){
                                        obj.uncheck();
                                    } else {
                                        obj.check();
                                    }
                            }
                        }
                    }

Tags for this Thread

Posting Permissions

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