{
    "type": "Ext.app.Controller",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "designer|userClassName": "Download"
    },
    "designerId": "2c374d8c-02f4-4aa6-80c9-f9d083bacc56",
    "cn": [
        {
            "type": "controllerref",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "ref": "treegrid",
                "selector": "#treegrid"
            },
            "designerId": "0bd25d8d-16d4-454e-8e39-8ebb09651b87"
        },
        {
            "type": "fixedfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "application"
                ],
                "fn": "init",
                "implHandler": [
                    "this.control({\r",
                    "    '#riskDetailsPDF': {\r",
                    "\t\tclick: this.getDetailsPDF\r",
                    "    },\r",
                    "\t'#riskDetailsActivePDF': {\r",
                    "\t\tclick: this.getDetailsActivePDF\r",
                    "\t}\r",
                    "});\r",
                    ""
                ]
            },
            "designerId": "4ff0d8dc-2a52-42d9-98a9-56ff486391be"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "btn"
                ],
                "fn": "getDetailsPDF",
                "implHandler": [
                    "btn.disable();\r",
                    "\r",
                    "var risk = this.getTreegrid().getSelectionModel().getSelection()[0];\r",
                    "\r",
                    "var iframe = document.getElementById(\"hiddenIFrameCurrent\");\r",
                    "if(iframe === null) {\r",
                    "    iframe = document.createElement('iframe');\r",
                    "    iframe.id = \"hiddenIFrameCurrent\";\r",
                    "    iframe.style.display = 'none';\r",
                    "    document.body.appendChild(iframe);\r",
                    "}\r",
                    "iframe.src = '../../service/download_pdf.php' + document.location.search + '&type=risk_details_pdf&risk_id='+risk.get('id');\r",
                    "\r",
                    "btn.blur();\r",
                    "setTimeout(function(){\r",
                    "\tbtn.enable();\r",
                    "}, 2500);"
                ]
            },
            "designerId": "527968b2-c570-4cce-9266-bbce94594bf0"
        },
        {
            "type": "basicfunction",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "designer|params": [
                    "btn"
                ],
                "fn": "getDetailsActivePDF",
                "implHandler": [
                    "btn.disable();\r",
                    "\r",
                    "var risk = this.getTreegrid().getSelectionModel().getSelection()[0];\r",
                    "\r",
                    "var iframe = document.getElementById(\"hiddenIFrameCurrent\");\r",
                    "if(iframe === null) {\r",
                    "    iframe = document.createElement('iframe');\r",
                    "    iframe.id = \"hiddenIFrameCurrent\";\r",
                    "    iframe.style.display = 'none';\r",
                    "    document.body.appendChild(iframe);\r",
                    "}\r",
                    "iframe.src = '../../service/download_pdf.php' + document.location.search + '&type=risk_details_active_pdf&rule_type=crit_role';\r",
                    "\r",
                    "btn.blur();\r",
                    "setTimeout(function(){\r",
                    "\tbtn.enable();\r",
                    "}, 2500);"
                ]
            },
            "designerId": "665dd718-00ba-4e4d-984d-5636e2b9bfab"
        }
    ]
}