{
    "type": "Ext.app.Controller",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "designer|userClassName": "GUIController"
    },
    "designerId": "11da9ea8-16fe-45b4-ab3b-66ca1df94e39",
    "cn": [
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "treegrid",
                "selector": "#treegrid"
            },
            "designerId": "e447d7a5-5a10-47c0-9ab3-aa31a813ed57"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "viewRuleHistoryButton",
                "selector": "#viewRuleHistoryButton"
            },
            "designerId": "9eb2d44c-fccb-4a15-965b-18858194d2c8"
        },
        {
            "type": "fixedfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "application"
                ],
                "fn": "init",
                "implHandler": [
                    "//add listener to treegrid\r",
                    "this.control({\r",
                    "    '#treegrid': {\r",
                    "        selectionchange: function(model, selected, eOpts) {\r",
                    "            this.selectionHasChanged(selected);\r",
                    "        }\r",
                    "    }\r",
                    "});"
                ]
            },
            "designerId": "adb3d318-fca2-4844-8615-2379e00ca3b8"
        },
        {
            "type": "fixedfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "fn": "onLaunch",
                "implHandler": [
                    "/*\r",
                    "var task = new Ext.util.DelayedTask(function(args){\r",
                    "    var mygrid = args.grid;\r",
                    "    mygrid.getStore().load();\r",
                    "    mygrid.expandAll();\r",
                    "});\r",
                    "var mygrid = this.getTreegrid();\r",
                    "task.delay(3000, null, null, [{grid: mygrid}]);\r",
                    "*/"
                ]
            },
            "designerId": "a43e4431-1d57-42cb-af9a-98a1db220d84"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "selected"
                ],
                "fn": "selectionHasChanged",
                "implHandler": [
                    "this.getViewRuleHistoryButton().disable();\r",
                    "\r",
                    "if(selected.length == 1) {\r",
                    "\tvar rec = selected[0];\r",
                    "\tif(!rec.isLeaf()) { //must be a group then\r",
                    "\t\tif(!rec.isExpanded() && rec.isExpandable())\r",
                    "\t\t\trec.expand();\r",
                    "\t\tconsole.log(rec);\r",
                    "\t}\r",
                    "\telse { //is risk\r",
                    "\t\tthis.getViewRuleHistoryButton().enable();\r",
                    "\t}\r",
                    "}\r",
                    ""
                ]
            },
            "designerId": "36f48f66-bc4c-4426-927b-1bd1fdfae54f"
        },
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "treegridSearch",
                "selector": "#treegridSearch"
            },
            "designerId": "bf605d3d-c43e-44d8-839b-2ac1de9df167"
        }
    ]
}