EXTJS의 CheckBox 클릭으로 텍스트 컨텐트 패키징 변경

var cb_openValve = new Ext.form.Checkbox({
            id: "myCheckbox",
            name: "myCheckbox",
            fieldLabel: ' ',
            boxLabel: ' ',
            checked: false,
            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, ' ');
            }
        });

좋은 웹페이지 즐겨찾기