Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: Set Checkbox boxLabel dynamically

  1. #21

    Default

    Code:
                                    {
                                        xtype: 'checkbox',
                                        fieldLabel: 'URGENCIA',
                                        labelSeparator: ' ',
                                        labelWidth: 73,
                                        name: 'urgencia',
                                        listeners: {
                                            change: function (cBox, nV, oV, eOpts) {
                                                if (nV) {
                                                    cBox.setFieldLabel(
                                                            '<div style="color: red;">URGENCIA<div>');
                                                } else {
                                                    cBox.setFieldLabel(
                                                            '<div style="color: black;">URGENCIA<div>');
                                                }
                                            }
                                        }
                                    }

  2. #22
    Ext JS Premium Member
    Join Date
    Feb 2008
    Posts
    17

    Default

    Condor:
    Ext.override(Ext.form.Checkbox, {
    setBoxLabel: function(boxLabel){
    this.boxLabel = boxLabel;
    if(this.rendered){
    this.wrap.child('.x-form-cb-label').update(boxLabel);
    }
    }
    });



    Thanks Condor, this works great !

Page 3 of 3 FirstFirst 123

Posting Permissions

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