{
    "type": "Ext.panel.Panel",
    "reference": {
        "name": "items",
        "type": "array"
    },
    "codeClass": null,
    "userConfig": {
        "cls": [
            "gridpanel"
        ],
        "designer|userAlias": "lotes_actividadespanel",
        "designer|userClassName": "Lotes_actividadesPanel",
        "dock": null,
        "flex": 1,
        "height": null,
        "itemId": null,
        "scrollable": true,
        "title": "Lotes en Actividad",
        "titleAlign": "center",
        "width": null
    },
    "configAlternates": {
        "cls": "typedarray",
        "designer|userAlias": "string",
        "designer|userClassName": "string",
        "dock": "string",
        "flex": "number",
        "height": "auto",
        "itemId": "string",
        "scrollable": "auto",
        "title": "string",
        "titleAlign": "string",
        "width": "auto"
    },
    "name": "MyPanel1",
    "designerId": "87b132a1-31e1-49af-8999-f740dd67cf45",
    "viewControllerInstanceId": "1691b9bb-70e3-456b-b2c7-678582a8aecf",
    "viewModelInstanceId": "994a49db-bfa5-49e8-9690-2a208b8f75fe",
    "cn": [
        {
            "type": "Ext.panel.Tool",
            "reference": {
                "name": "tools",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "cls": [
                    "paneltool"
                ],
                "iconCls": "x-fa fa-arrow-left"
            },
            "configAlternates": {
                "cls": "typedarray",
                "iconCls": "string"
            },
            "name": "MyTool3",
            "designerId": "e2638f19-b8ab-4c70-83e9-fcc5de213536",
            "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": "d633ea9c-d964-4b66-b162-f9fe9be36bdd"
                }
            ]
        },
        {
            "type": "basiceventbinding",
            "reference": {
                "name": "listeners",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "fn": "onPanelRender",
                "implHandler": [
                    "this.store_name = 'Lotes_actividades';",
                    "this.model_name = 'MyApp.model.Lotes_actividades';",
                    "this.form_name  = 'MyApp.view.AgregarLotesPanel';",
                    "var store = Ext.getStore(this.store_name);",
                    "this.form_store_array = [store];",
                    "f_crud.load_store(this.store_name, 'cod_actividad = ' + component.parent.codigo);"
                ],
                "name": "render",
                "scope": "me"
            },
            "configAlternates": {
                "fn": "string",
                "implHandler": "code",
                "name": "string",
                "scope": "string"
            },
            "name": "onPanelRender",
            "designerId": "f02d5424-fbc7-4b8e-abb1-bed3d837aeab"
        },
        {
            "type": "Ext.grid.Panel",
            "reference": {
                "name": "items",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "header": false,
                "hideHeaders": false,
                "itemId": "grid",
                "overlapHeader": false,
                "scrollable": null,
                "store": "Lotes_actividades",
                "title": "Lotes en Actividad"
            },
            "configAlternates": {
                "header": "boolean",
                "hideHeaders": "boolean",
                "itemId": "string",
                "overlapHeader": "boolean",
                "scrollable": "auto",
                "store": "store",
                "title": "string"
            },
            "name": "MyGridPanel3",
            "designerId": "c7a0a76e-c50f-457f-8bbf-56016ed057aa",
            "cn": [
                {
                    "type": "Ext.view.Table",
                    "reference": {
                        "name": "viewConfig",
                        "type": "object"
                    },
                    "codeClass": null,
                    "name": "MyTable3",
                    "designerId": "67732dc7-2065-43a6-84fe-4b659cd43ffd"
                },
                {
                    "type": "basiceventbinding",
                    "reference": {
                        "name": "listeners",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "fn": "onGridpanelItemLongpress",
                        "implHandler": [
                            "var morebox = this.down(\"#moreBox\");",
                            "morebox.columnWidth = 0.33;",
                            "morebox.layout.pack = 'end';",
                            "morebox.hide();",
                            "morebox.show();",
                            "",
                            "var editbox = this.down(\"#editBox\");",
                            "var deletebox = this.down(\"#deleteBox\");",
                            "editbox.show();",
                            "deletebox.show();",
                            "this.longpress = true;"
                        ],
                        "name": "itemlongpress",
                        "scope": "me"
                    },
                    "configAlternates": {
                        "fn": "string",
                        "implHandler": "code",
                        "name": "string",
                        "scope": "string"
                    },
                    "name": "onGridpanelItemLongpress",
                    "designerId": "11092193-1aa1-4cef-ab88-9abc14898c13"
                },
                {
                    "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": "8b5516b6-263d-49f0-a182-e53b1ae5e1f2"
                },
                {
                    "type": "basiceventbinding",
                    "reference": {
                        "name": "listeners",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "fn": "onGridpanelItemClick",
                        "implHandler": [
                            "if(!this.longpress) {",
                            "    var panelClass = \"MyApp.view.LaboresPanel\";",
                            "    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": "onGridpanelItemClick",
                    "designerId": "93188dd1-cbac-4ae4-941e-02097fdd0598"
                },
                {
                    "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": "c5ed96a4-27bb-4a75-8a03-2202bd9798de"
                },
                {
                    "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": "MyColumn20",
                    "designerId": "edc4437b-7559-4aff-91a6-eec9388736fb"
                },
                {
                    "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": "MyNumberColumn5",
                    "designerId": "d3f77b45-1860-48b5-a52f-43902c1caefc"
                },
                {
                    "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": "MyNumberColumn44",
                    "designerId": "8ea4fb02-8935-45a1-8376-a600ecd43a6c"
                },
                {
                    "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": "MyNumberColumn45",
                    "designerId": "1da7f9f3-3c85-4cf2-95a6-e3dd34175dc7"
                },
                {
                    "type": "Ext.grid.column.Column",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "nombre",
                        "text": "Nombre"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "text": "string"
                    },
                    "name": "MyColumn21",
                    "designerId": "13513917-e5f7-46ba-8218-d3e6ba2741b2"
                },
                {
                    "type": "Ext.grid.column.Number",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "cod_lote",
                        "format": "00",
                        "hidden": true,
                        "text": "Cod Lote"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "format": "string",
                        "hidden": "boolean",
                        "text": "string"
                    },
                    "name": "MyNumberColumn53",
                    "designerId": "b52ca8d7-6dae-424c-b09f-57f618cc7682"
                },
                {
                    "type": "Ext.grid.column.Number",
                    "reference": {
                        "name": "columns",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "dataIndex": "cod_actividad",
                        "format": "00",
                        "hidden": true,
                        "text": "Cod Actividad"
                    },
                    "configAlternates": {
                        "dataIndex": "datafield",
                        "format": "string",
                        "hidden": "boolean",
                        "text": "string"
                    },
                    "name": "MyNumberColumn54",
                    "designerId": "75aefeab-1d4c-461e-8a5a-c08f4ef06628"
                }
            ]
        },
        {
            "type": "basiceventbinding",
            "reference": {
                "name": "listeners",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "fn": "onGridpanelAfterRender",
                "implHandler": [
                    "this.setTitle(\"Lotes dedicados a \" + component.parent.nombre);"
                ],
                "name": "afterrender",
                "scope": "me"
            },
            "configAlternates": {
                "fn": "string",
                "implHandler": "code",
                "name": "string",
                "scope": "string"
            },
            "name": "onGridpanelAfterRender",
            "designerId": "7e85b688-c3b1-4f18-9480-ef7ffa591bf5"
        },
        {
            "type": "Ext.form.Panel",
            "reference": {
                "name": "dockedItems",
                "type": "array"
            },
            "codeClass": null,
            "userConfig": {
                "bodyPadding": 10,
                "designer|displayName": "gridControl",
                "dock": "bottom",
                "header": false,
                "layout": "column",
                "title": "My Form"
            },
            "configAlternates": {
                "bodyPadding": "auto",
                "designer|displayName": "string",
                "dock": "string",
                "header": "boolean",
                "layout": "string",
                "title": "string"
            },
            "name": "MyForm",
            "designerId": "7ad6df09-f36b-4e05-bc26-201711ecb5c2",
            "cn": [
                {
                    "type": "Ext.container.Container",
                    "reference": {
                        "name": "items",
                        "type": "array"
                    },
                    "codeClass": null,
                    "userConfig": {
                        "container|align": "stretch",
                        "container|pack": "center",
                        "designer|displayName": "",
                        "itemId": "moreBox",
                        "layout": "hbox",
                        "layout|columnWidth": 1
                    },
                    "configAlternates": {
                        "container|align": "string",
                        "container|pack": "string",
                        "designer|displayName": "string",
                        "itemId": "string",
                        "layout": "string",
                        "layout|columnWidth": "auto"
                    },
                    "name": "MyContainer5",
                    "designerId": "17cc7448-6310-49f0-8a39-550cf77d6cc2",
                    "cn": [
                        {
                            "type": "Ext.button.Button",
                            "reference": {
                                "name": "items",
                                "type": "array"
                            },
                            "codeClass": null,
                            "userConfig": {
                                "iconCls": "x-fa fa-plus",
                                "layout|flex": null,
                                "text": "Agregar"
                            },
                            "configAlternates": {
                                "iconCls": "string",
                                "layout|flex": "number",
                                "text": "string"
                            },
                            "name": "MyButton",
                            "designerId": "5324287a-4a03-4bb5-a08b-9b7709ad1527",
                            "cn": [
                                {
                                    "type": "fixedfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|params": [
                                            "button",
                                            "e"
                                        ],
                                        "fn": "handler",
                                        "implHandler": [
                                            "var lotes_actividades_grid = this.up(\"[cls=gridpanel]\");",
                                            "f_crud.form_open(lotes_actividades_grid);"
                                        ]
                                    },
                                    "configAlternates": {
                                        "designer|params": "typedarray",
                                        "fn": "string",
                                        "implHandler": "code"
                                    },
                                    "name": "handler",
                                    "designerId": "34a66fc9-318c-4067-9361-15cfa278e42e"
                                }
                            ]
                        }
                    ]
                },
                {
                    "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": "MyContainer",
                    "designerId": "edaf38cd-bda4-4b0e-aa96-12523750b16c",
                    "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": "68b6c494-4d34-4572-bb65-90f5c2937096",
                            "cn": [
                                {
                                    "type": "fixedfunction",
                                    "reference": {
                                        "name": "items",
                                        "type": "array"
                                    },
                                    "codeClass": null,
                                    "userConfig": {
                                        "designer|params": [
                                            "button",
                                            "e"
                                        ],
                                        "fn": "handler",
                                        "implHandler": [
                                            "var lotes_actividades_grid = this.up('[cls=gridpanel]');",
                                            "lotes_actividades_grid.form_name = 'MyApp.view.Lotes_ActividadesForm';",
                                            "f_crud.form_open(lotes_actividades_grid,'EDIT');"
                                        ]
                                    },
                                    "configAlternates": {
                                        "designer|params": "typedarray",
                                        "fn": "string",
                                        "implHandler": "code"
                                    },
                                    "name": "handler",
                                    "designerId": "497a945b-f34f-42ad-9f56-9789f8a92dbd"
                                }
                            ]
                        }
                    ]
                },
                {
                    "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": "MyContainer6",
                    "designerId": "620ca333-35e4-4727-acb9-e719d4414c6f",
                    "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": "5b77ec13-be98-42e4-9d84-ac5b3752626c",
                            "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: 'Labores',",
                                            "    field: 'cod_lote_actividad',",
                                            "    msgTitle: 'Actividad con labores asignadas',",
                                            "    message: 'No puede borrar una actividad con labores asignadas, <br> borre esas labores primero'",
                                            "};",
                                            "f_crud.grid_check_delete(gridPanel,checkConfig);",
                                            ""
                                        ]
                                    },
                                    "configAlternates": {
                                        "designer|params": "typedarray",
                                        "fn": "string",
                                        "implHandler": "code"
                                    },
                                    "name": "handler",
                                    "designerId": "a65bdb49-dcf8-4567-bfa8-e9e2bc3fa7af"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}