{
    "type": "Ext.panel.Panel",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "cls": [
            "gridpanel"
        ],
        "designer|userAlias": "actividadespanel",
        "designer|userClassName": "ActividadesPanel",
        "flex": 1,
        "height": null,
        "iconCls": "",
        "itemId": null,
        "scrollable": true,
        "title": "Actividades",
        "titleAlign": "center",
        "width": null
    },
    "configAlternates": {
        "cls": "typedarray",
        "designer|userAlias": "string",
        "designer|userClassName": "string",
        "flex": "number",
        "height": "auto",
        "iconCls": "string",
        "itemId": "string",
        "scrollable": "auto",
        "title": "string",
        "titleAlign": "string",
        "width": "auto"
    },
    "name": "MyPanel1",
    "designerId": "e5173f9d-31c3-45a5-9332-8e91115a9acc",
    "viewControllerInstanceId": "d8549c80-044d-48d4-95a3-fd4f31c56332",
    "viewModelInstanceId": "846545cf-1cc9-4ee7-8f25-7057cd77e16e",
    "cn": [
        {
            "type": "Ext.panel.Tool",
            "reference": {
                "name": "tools",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "cls": [
                    "paneltool"
                ],
                "iconCls": "x-fa fa-arrow-left",
                "type": null
            },
            "configAlternates": {
                "cls": "typedarray",
                "iconCls": "string",
                "type": "string"
            },
            "name": "MyTool",
            "designerId": "748071fc-2c41-47df-916a-31764b0a67b9",
            "cn": [
                {
                    "type": "basiceventbinding",
                    "reference": {
                        "name": "listeners",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "fn": "onToolClick",
                        "implHandler": [
                            "var thisPanel = MyApp.main.getLayout().getActiveItem();",
                            "MyApp.main.getLayout().prev();",
                            "thisPanel.close();"
                        ],
                        "name": "click",
                        "scope": "me"
                    },
                    "configAlternates": {
                        "fn": "string",
                        "implHandler": "code",
                        "name": "string",
                        "scope": "string"
                    },
                    "name": "onToolClick",
                    "designerId": "ee6e8a1c-8745-4f57-bf3c-ac496b971f02"
                }
            ]
        },
        {
            "type": "Ext.grid.Panel",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "header": false,
                "itemId": "grid",
                "store": "Actividades",
                "title": "Actividades"
            },
            "configAlternates": {
                "header": "boolean",
                "itemId": "string",
                "store": "store",
                "title": "string"
            },
            "name": "MyGridPanel1",
            "designerId": "2aee2b89-627f-4c4b-9a53-e8802391f076",
            "cn": [
                {
                    "type": "Ext.view.Table",
                    "reference": {
                        "name": "viewConfig",
                        "type": "object"
                    },
                    "codeClass": null,
                    "name": "MyTable1",
                    "designerId": "cb612f26-c31b-4bb8-a2ec-d82f89b549f8"
                },
                {
                    "type": "basiceventbinding",
                    "reference": {
                        "name": "listeners",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "fn": "onGridpanelSelectionChange",
                        "implHandler": [
                            "this.record = selected[0];"
                        ],
                        "name": "selectionchange",
                        "scope": "me"
                    },
                    "configAlternates": {
                        "fn": "string",
                        "implHandler": "code",
                        "name": "string",
                        "scope": "string"
                    },
                    "name": "onGridpanelSelectionChange",
                    "designerId": "78b12089-d2ef-4269-bf61-ee9b158d930c"
                },
                {
                    "type": "basiceventbinding",
                    "reference": {
                        "name": "listeners",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "fn": "onGridItemLongpress",
                        "implHandler": [
                            "var newbox = this.down(\"#newBox\");",
                            "var editbox = this.down(\"#editBox\");",
                            "var deletebox = this.down(\"#deleteBox\");",
                            "newbox.columnWidth = 0.33;",
                            "newbox.layout.pack = 'end';",
                            "newbox.hide();",
                            "newbox.show();",
                            "editbox.show();",
                            "deletebox.show();",
                            "this.longpress = true;"
                        ],
                        "name": "itemlongpress",
                        "scope": "me"
                    },
                    "configAlternates": {
                        "fn": "string",
                        "implHandler": "code",
                        "name": "string",
                        "scope": "string"
                    },
                    "name": "onGridItemLongpress",
                    "designerId": "12960829-0501-4574-9bdc-3f4301b05755"
                },
                {
                    "type": "basiceventbinding",
                    "reference": {
                        "name": "listeners",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "fn": "onGridItemClick",
                        "implHandler": [
                            "if(!this.longpress) {",
                            "    var panelClass = \"MyApp.view.Lotes_actividadesPanel\";",
                            "    var newPan = Ext.create(panelClass);",
                            "    newPan.parent = record.data;",
                            "    MyApp.main.add(newPan);",
                            "    MyApp.main.getLayout().setActiveItem(newPan);",
                            "}",
                            "this.longpress = false;"
                        ],
                        "name": "itemclick",
                        "scope": "me"
                    },
                    "configAlternates": {
                        "fn": "string",
                        "implHandler": "code",
                        "name": "string",
                        "scope": "string"
                    },
                    "name": "onGridItemClick",
                    "designerId": "91dc2d76-19c1-40cf-a1ce-f7e38f50c302"
                },
                {
                    "type": "basiceventbinding",
                    "reference": {
                        "name": "listeners",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "fn": "onGridBeforeRender",
                        "implHandler": [
                            "f_crud.renderGridWidth(component);"
                        ],
                        "name": "beforerender",
                        "scope": "me"
                    },
                    "configAlternates": {
                        "fn": "string",
                        "implHandler": "code",
                        "name": "string",
                        "scope": "string"
                    },
                    "name": "onGridBeforeRender",
                    "designerId": "a19c58fc-e260-4018-a736-4c5ac47ade38"
                },
                {
                    "type": "Ext.grid.column.Column",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "estado_registro",
                        "hidden": true,
                        "text": "Estado Registro"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "hidden": "boolean",
                        "text": "string"
                    },
                    "name": "MyColumn5",
                    "designerId": "12b444fd-d478-48e2-937f-56f748623a74"
                },
                {
                    "type": "Ext.grid.column.Number",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "id",
                        "hidden": true,
                        "text": "ID"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "hidden": "boolean",
                        "text": "string"
                    },
                    "name": "MyNumberColumn10",
                    "designerId": "f838356d-cb2f-4887-b296-c0498b53594f"
                },
                {
                    "type": "Ext.grid.column.Number",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "uid",
                        "format": "00",
                        "hidden": true,
                        "text": "Uid"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "format": "string",
                        "hidden": "boolean",
                        "text": "string"
                    },
                    "name": "MyNumberColumn16",
                    "designerId": "6f9e42c9-0ff0-4e6b-a64c-be3626e7b8d9"
                },
                {
                    "type": "Ext.grid.column.Number",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "codigo",
                        "format": "00",
                        "text": "Codigo"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "format": "string",
                        "text": "string"
                    },
                    "name": "MyNumberColumn17",
                    "designerId": "ae14a953-f040-4b74-bde1-804d7e4a87ca"
                },
                {
                    "type": "Ext.grid.column.Column",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "nombre",
                        "text": "Nombre"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "text": "string"
                    },
                    "name": "MyColumn8",
                    "designerId": "45650de5-b3aa-47b2-a4e1-e00b7d471bd5"
                },
                {
                    "type": "Ext.grid.column.Date",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "desde",
                        "format": "d/m/Y",
                        "hidden": true,
                        "text": "Desde"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "format": "string",
                        "text": "string",
                        "hidden": "boolean"
                    },
                    "name": "MyDateColumn1",
                    "designerId": "910a0b8b-8c7b-4417-a6be-7e2d75bde266"
                },
                {
                    "type": "Ext.grid.column.Date",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "hasta",
                        "format": "d/m/Y",
                        "hidden": true,
                        "text": "Hasta"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "format": "string",
                        "text": "string",
                        "hidden": "boolean"
                    },
                    "name": "MyDateColumn2",
                    "designerId": "af006c2b-8b53-41cf-89eb-2212d4a69006"
                },
                {
                    "type": "Ext.grid.column.Number",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "cod_periodo",
                        "format": "00",
                        "text": "Campaña"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "format": "string",
                        "text": "string"
                    },
                    "name": "MyNumberColumn18",
                    "designerId": "e1e5056a-068a-4096-8f44-bdf5a8a0c5f7",
                    "cn": [
                        {
                            "type": "basicfunction",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "designer|params": [
                                    "value, metaData, record, rowIndex, colIndex, store"
                                ],
                                "fn": "renderer",
                                "implHandler": [
                                    "",
                                    "return f_crud.getDisplayValue('Campanias', value, 'descripcion');"
                                ]
                            },
                            "configAlternates": {
                                "designer|params": "typedarray",
                                "fn": "string",
                                "implHandler": "code"
                            },
                            "name": "renderer",
                            "designerId": "645d10d3-9084-4b77-abec-ef774cdbf7f4"
                        }
                    ]
                }
            ]
        },
        {
            "type": "basiceventbinding",
            "reference": {
                "name": "listeners",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "fn": "onPanelRender",
                "implHandler": [
                    "this.store_name = 'Actividades';",
                    "this.model_name = 'MyApp.model.Actividades';",
                    "this.form_name  = 'MyApp.view.ActividadesForm';",
                    "var store = Ext.getStore(this.store_name);",
                    "this.form_store_array = [store];",
                    "f_crud.load_store(this.store_name);"
                ],
                "name": "render",
                "scope": "me"
            },
            "configAlternates": {
                "fn": "string",
                "implHandler": "code",
                "name": "string",
                "scope": "string"
            },
            "name": "onPanelRender",
            "designerId": "9210d4d4-ad4c-4e35-ba23-dab9516c234f"
        },
        {
            "type": "Ext.form.Panel",
            "reference": {
                "name": "dockedItems",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "bodyPadding": 10,
                "designer|displayName": "gridControl",
                "dock": "bottom",
                "flex": null,
                "header": false,
                "layout": "column",
                "title": "My Form"
            },
            "configAlternates": {
                "bodyPadding": "auto",
                "designer|displayName": "string",
                "dock": "string",
                "flex": "number",
                "header": "boolean",
                "layout": "string",
                "title": "string"
            },
            "name": "MyForm4",
            "designerId": "72fc9d9a-a61d-405e-b53e-f20e22cc4c98",
            "cn": [
                {
                    "type": "Ext.container.Container",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "container|align": "stretch",
                        "container|pack": "center",
                        "itemId": "newBox",
                        "layout": "hbox",
                        "layout|columnWidth": 1
                    },
                    "configAlternates": {
                        "container|align": "string",
                        "container|pack": "string",
                        "itemId": "string",
                        "layout": "string",
                        "layout|columnWidth": "auto"
                    },
                    "name": "MyContainer2",
                    "designerId": "e418c71e-789f-4dc5-a984-725ec13297d5",
                    "cn": [
                        {
                            "type": "Ext.button.Button",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "cls": "",
                                "iconCls": "x-fa fa-plus",
                                "text": "Nuevo"
                            },
                            "configAlternates": {
                                "cls": "string",
                                "iconCls": "string",
                                "text": "string"
                            },
                            "name": "MyButton3",
                            "designerId": "865f6c46-1d1a-4703-b627-002d22420f0f",
                            "cn": [
                                {
                                    "type": "fixedfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|params": [
                                            "button",
                                            "e"
                                        ],
                                        "fn": "handler",
                                        "implHandler": [
                                            "f_crud.form_open(this.up(\"[cls=gridpanel]\"),'ADD');"
                                        ]
                                    },
                                    "configAlternates": {
                                        "designer|params": "typedarray",
                                        "fn": "string",
                                        "implHandler": "code"
                                    },
                                    "name": "handler",
                                    "designerId": "1e5c35d3-bd4a-4ddf-8ed1-1e2d2fecb2c1"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "Ext.container.Container",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "container|align": "stretch",
                        "container|pack": "center",
                        "hidden": true,
                        "itemId": "editBox",
                        "layout": "hbox",
                        "layout|columnWidth": 0.33
                    },
                    "configAlternates": {
                        "container|align": "string",
                        "container|pack": "string",
                        "hidden": "boolean",
                        "itemId": "string",
                        "layout": "string",
                        "layout|columnWidth": "auto"
                    },
                    "name": "MyContainer3",
                    "designerId": "563dd06f-827b-4c26-9e0a-539ac606656e",
                    "cn": [
                        {
                            "type": "Ext.button.Button",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "cls": "",
                                "iconCls": "x-fa fa-pencil",
                                "margin": "0 0 0 10",
                                "text": "Editar"
                            },
                            "configAlternates": {
                                "cls": "string",
                                "iconCls": "string",
                                "margin": "auto",
                                "text": "string"
                            },
                            "name": "MyButton5",
                            "designerId": "1b22ee72-418f-4071-8549-58cfb2b7665f",
                            "cn": [
                                {
                                    "type": "fixedfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|params": [
                                            "button",
                                            "e"
                                        ],
                                        "fn": "handler",
                                        "implHandler": [
                                            "f_crud.form_open(this.up('[cls=gridpanel]'),'EDIT');"
                                        ]
                                    },
                                    "configAlternates": {
                                        "designer|params": "typedarray",
                                        "fn": "string",
                                        "implHandler": "code"
                                    },
                                    "name": "handler",
                                    "designerId": "1e8e76c1-f9f4-4e59-8af1-63c16525175e"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "Ext.container.Container",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "container|align": "stretch",
                        "hidden": true,
                        "itemId": "deleteBox",
                        "layout": "hbox",
                        "layout|columnWidth": 0.33
                    },
                    "configAlternates": {
                        "container|align": "string",
                        "hidden": "boolean",
                        "itemId": "string",
                        "layout": "string",
                        "layout|columnWidth": "auto"
                    },
                    "name": "MyContainer4",
                    "designerId": "947cfe45-808b-4ebf-a35a-b58e2fb38a74",
                    "cn": [
                        {
                            "type": "Ext.button.Button",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "cls": "",
                                "iconCls": "x-fa fa-trash",
                                "layout|flex": null,
                                "margin": "0 0 0 10",
                                "text": "Borrar"
                            },
                            "configAlternates": {
                                "cls": "string",
                                "iconCls": "string",
                                "layout|flex": "number",
                                "margin": "auto",
                                "text": "string"
                            },
                            "name": "MyButton4",
                            "designerId": "f31bbfde-5649-4d7c-b138-cc1eac55568e",
                            "cn": [
                                {
                                    "type": "fixedfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|params": [
                                            "button",
                                            "e"
                                        ],
                                        "fn": "handler",
                                        "implHandler": [
                                            "var gridPanel = this.up('[cls=gridpanel]');",
                                            "var checkConfig = {",
                                            "    table: 'Lotes_actividades',",
                                            "    field: 'cod_actividad',",
                                            "    msgTitle: 'Actividad asignada',",
                                            "    message: 'No puede borrar una actividad que ya fue asignada a un lote, <br> desvincule esta actividad de los lotes a los que fue ligada'",
                                            "};",
                                            "f_crud.grid_check_delete(gridPanel,checkConfig);"
                                        ]
                                    },
                                    "configAlternates": {
                                        "designer|params": "typedarray",
                                        "fn": "string",
                                        "implHandler": "code"
                                    },
                                    "name": "handler",
                                    "designerId": "d68c68f6-f720-4792-8b47-48dc11725be8"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}