Pman.Tab.AdminCompanies.bjs
[Pman.Admin] / Pman.Tab.AdminTypesCompany.bjs
1 {
2     "id": "roo-file-150",
3     "name": "Pman.Tab.AdminTypesCompany",
4     "parent": "Pman.Tab.AdminTypes",
5     "title": "Pman.Tab.AdminTypesCompany",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminTypesCompany.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "core_company_type",
17             "title": "Company Types",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|render": "function() \n{\n    _this.grid = this; \n   _this.dialog = Pman.Dialog.AdminGenericName;\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
24                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show({\n         id : this.getDataSource().getAt(rowIndex).data.id,\n        _title : \"Edit Company Type\",\n        _table : _this.panel.tableName\n    }, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "name",
28                     "loadMask": true,
29                     "xtype": "Grid",
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "*prop": "dataSource",
34                             "xtype": "Store",
35                             "remoteSort": true,
36                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
37                             "|xns": "Roo.data",
38                             "items": [
39                                 {
40                                     "*prop": "proxy",
41                                     "method": "GET",
42                                     "xtype": "HttpProxy",
43                                     "|url": "baseURL + '/Roo/core_company_type.php'",
44                                     "|xns": "Roo.data"
45                                 },
46                                 {
47                                     "|xns": "Roo.data",
48                                     "xtype": "JsonReader",
49                                     "totalProperty": "total",
50                                     "root": "data",
51                                     "*prop": "reader",
52                                     "id": "id",
53                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    }\n]"
54                                 }
55                             ]
56                         },
57                         {
58                             "*prop": "footer",
59                             "xtype": "PagingToolbar",
60                             "pageSize": 25,
61                             "displayInfo": true,
62                             "displayMsg": "Displaying core_image_type{0} - {1} of {2}",
63                             "emptyMsg": "No core_image_type found",
64                             "|xns": "Roo"
65                         },
66                         {
67                             "*prop": "toolbar",
68                             "xtype": "Toolbar",
69                             "|xns": "Roo",
70                             "items": [
71                                 {
72                                     "listeners": {
73                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { \n        id : 0,\n        _title : \"Add Company Type\",\n        _table : _this.panel.tableName\n     } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
74                                     },
75                                     "cls": "x-btn-text-icon",
76                                     "text": "Add",
77                                     "xtype": "Button",
78                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
79                                     "|xns": "Roo.Toolbar"
80                                 },
81                                 {
82                                     "listeners": {
83                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show({\n        id : s[0].data.id,\n        _title : \"Edit Company Type\",\n        _table : _this.panel.tableName\n        }, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
84                                     },
85                                     "cls": "x-btn-text-icon",
86                                     "text": "Edit",
87                                     "xtype": "Button",
88                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
89                                     "|xns": "Roo.Toolbar"
90                                 },
91                                 {
92                                     "listeners": {
93                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'core_company_type'); \n}\n        "
94                                     },
95                                     "cls": "x-btn-text-icon",
96                                     "text": "Delete",
97                                     "xtype": "Button",
98                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
99                                     "|xns": "Roo.Toolbar"
100                                 }
101                             ]
102                         },
103                         {
104                             "xtype": "ColumnModel",
105                             "header": "Name",
106                             "width": 200,
107                             "dataIndex": "name",
108                             "|renderer": "function(v) { return String.format('{0}', v); }",
109                             "|xns": "Roo.grid",
110                             "*prop": "colModel[]"
111                         }
112                     ]
113                 }
114             ]
115         }
116     ],
117     "permname": "",
118     "modOrder": "001"
119 }