Pman.Tab.CmsProduct.js
[Pman.Cms] / Pman.Tab.CmsCategoryType.bjs
1 {
2     "id": "roo-file-131",
3     "name": "Pman.Tab.CmsCategoryType",
4     "parent": "Pman.Tab.Cms",
5     "title": "Pman.Tab.CmsCategoryType",
6     "path": "/home/alan/gitlive/Pman.Cms/Pman.Tab.CmsCategoryType.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": "cms_category_type",
17             "title": "Category 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.CmsCategoryType;\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( this.getDataSource().getAt(rowIndex), 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                                     "xtype": "HttpProxy",
42                                     "method": "GET",
43                                     "|url": "baseURL + '/Roo/cms_category_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 cms_category_type{0} - {1} of {2}",
63                             "emptyMsg": "No cms_category_type found",
64                             "|xns": "Roo"
65                         },
66                         {
67                             "*prop": "toolbar",
68                             "xtype": "Toolbar",
69                             "|xns": "Roo",
70                             "items": [
71                                 {
72                                     "|xns": "Roo.Toolbar",
73                                     "xtype": "Fill"
74                                 },
75                                 {
76                                     "text": "Add",
77                                     "xtype": "Button",
78                                     "cls": "x-btn-text-icon",
79                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
80                                     "listeners": {
81                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
82                                     },
83                                     "|xns": "Roo.Toolbar"
84                                 },
85                                 {
86                                     "text": "Edit",
87                                     "xtype": "Button",
88                                     "cls": "x-btn-text-icon",
89                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
90                                     "listeners": {
91                                         "|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(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
92                                     },
93                                     "|xns": "Roo.Toolbar"
94                                 },
95                                 {
96                                     "text": "Delete",
97                                     "cls": "x-btn-text-icon",
98                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
99                                     "xtype": "Button",
100                                     "listeners": {
101                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'cms_category_type'); \n}\n        "
102                                     },
103                                     "|xns": "Roo.Toolbar"
104                                 }
105                             ]
106                         },
107                         {
108                             "xtype": "ColumnModel",
109                             "header": "Name",
110                             "width": 200,
111                             "dataIndex": "name",
112                             "|renderer": "function(v) { return String.format('{0}', v); }",
113                             "|xns": "Roo.grid",
114                             "*prop": "colModel[]"
115                         }
116                     ]
117                 }
118             ]
119         }
120     ],
121     "permname": ""
122 }