{
    "type": "Ext.app.Controller",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "designer|userClassName": "Data"
    },
    "designerId": "15aebaba-f57f-48f2-a621-a4da97429111",
    "cn": [
        {
            "type": "fixedfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "application"
                ],
                "fn": "init",
                "implHandler": [
                    "this.control({\r",
                    "\t'#grid':{\r",
                    "\t\tselectionchange: this.selectionchanged\r",
                    "\t},\r",
                    "\t'#btnActive': {\r",
                    "\t\tclick: this.setActive\r",
                    "\t},\r",
                    "\t'#btnInactive': {\r",
                    "\t\tclick: this.setInactive\r",
                    "\t}\r",
                    "\r",
                    "});"
                ]
            },
            "designerId": "5009c083-979a-4c43-9fb8-07e62edfb08a"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "grid",
                "selector": "#grid"
            },
            "designerId": "5d5c866c-6612-4dac-bc35-524d3dadf46f"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "btnActive",
                "selector": "#btnActive"
            },
            "designerId": "f39b8fab-e796-46f5-80ea-e0049a9ef975"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "btnInactive",
                "selector": "#btnInactive"
            },
            "designerId": "5dd8dc4e-91c5-4da7-8ca8-73417e545152"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "component",
                    "selection"
                ],
                "fn": "selectionchanged",
                "implHandler": [
                    "this.getBtnActive().disable();\r",
                    "this.getBtnInactive().disable();\r",
                    "\r",
                    "if(selection.length > 0) {\r",
                    "\tvar selected = selection[0];\r",
                    "\tif(selected.get('status') == 'A') {\r",
                    "\t\tthis.getBtnInactive().enable();\r",
                    "\t}\r",
                    "\telse {\r",
                    "\t\tthis.getBtnActive().enable();\r",
                    "\t}\r",
                    "}"
                ]
            },
            "designerId": "8db71cec-fb9e-4416-8701-fc6b6cd4523f"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "btn"
                ],
                "fn": "setActive",
                "implHandler": [
                    "btn.blur();\r",
                    "var selection = this.getGrid().getSelectionModel().getSelection();\r",
                    "if(selection.length > 0) {\r",
                    "\tvar record = selection[0];\r",
                    "\trecord.set('status', 'A');\r",
                    "}"
                ]
            },
            "designerId": "f77cd4f0-3637-413c-9069-aa7dab3e6807"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "btn"
                ],
                "fn": "setInactive",
                "implHandler": [
                    "btn.blur();\r",
                    "var selection = this.getGrid().getSelectionModel().getSelection();\r",
                    "\r",
                    "if(!Ext.isEmpty(selection)) {\r",
                    "\tif(selection.length > 0) {\r",
                    "\t\tvar record = selection[0];\r",
                    "\t\trecord.set('status', 'I');\r",
                    "\t}\r",
                    "}"
                ]
            },
            "designerId": "a204387a-8247-4413-8cbf-8724acd76afa"
        }
    ]
}