Extjs 확인란 내용 텍스트 변경

// extjs 5.0
var cb_open = new Ext.form.Checkbox({
            id: "isOpen",
            name: "isOpen",
            fieldLabel: ' ',
            boxLabel: ' ( )',
            margin: '5 0 0 10',
            hideTrigger: true,
            checked: false,
            inputValue: '0',
            listeners: {
                click: {// 
                    element: 'el',
                    fn: function (obj, o2, o3, o4, o5) {
                        var thisObj = Ext.getCmp(this.id);
                        var isCheck = thisObj.getValue();
                        if (isCheck) {
                            thisObj.setCheck();
                        }
                        else {
                            thisObj.setUnCheck();
                        }
                    }
                }
            },
            // 
            // 
            setText: function (value, textStr) {
                var thisObj = Ext.getCmp(this.id);
                thisObj.setValue(value);
                thisObj.boxLabel = textStr;
                thisObj.getEl().down('.x-form-cb-label').update(textStr);// 
            },
            // 
            setCheck: function () {
                var thisObj = Ext.getCmp(this.id);
                thisObj.setText(true, ' ');
            },
            // 
            setUnCheck: function () {
                var thisObj = Ext.getCmp(this.id);
                thisObj.setText(false, ' ');

            }
        });
// 
Ext.getCmp('isOpen').setCheck();
Ext.getCmp('isOpen').setUnCheck();

좋은 웹페이지 즐겨찾기