3 "name": "Pman.Tab.AdminEnums",
4 "parent": "Pman.Tab.Admin",
5 "title": "Pman.Tab.AdminEnums",
6 "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminEnums.bjs",
10 "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
16 "tableName": "core_enum",
17 "title": "Enum options",
23 "|render": "function() \n{\n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}",
24 "afteredit": "function (e)\n{\n e.record.commit(); \n}",
25 "cellclick": "function (_self, rowIndex, columnIndex, e)\n{\n\n var di = this.colModel.getDataIndex(columnIndex);\n if (di != 'active') {\n return;\n }\n \n var rec = _this.grid.ds.getAt(rowIndex);\n \n rec.set('active', rec.data.active ? 0 : 1);\n rec.commit();\n \n \n}"
28 "autoExpandColumn": "name",
31 "xtype": "EditorGrid",
36 "beforeload": "function (_self, options)\n{\n if (!_this.etypeCombo) {\n return false;\n }\n options.params.etype = _this.etypeCombo.getValue();\n if (!options.params.etype.length) {\n return false;\n }\n}",
37 "update": "function (_self, record, operation)\n{\n if (operation != Roo.data.Record.COMMIT) {\n return;\n }\n // got commit..\n new Pman.Request({\n url : baseURL + '/Roo/Core_enum.php',\n method : 'POST',\n params : {\n id : record.data.id,\n etype : _this.etypeCombo.getValue(),\n name : record.data.name,\n active : record.data.active,\n seqid : record.data.seqid\n }, \n success : function(res) {\n //Roo.log(data);\n // update the ID if it's not set..\n if (record.data.id * 1 < 1) {\n record.set('id', res.data.id);\n }\n }\n });\n \n}"
39 "*prop": "dataSource",
42 "|sortInfo": "{ field : 'etype', direction: 'ASC' }",
49 "|url": "baseURL + '/Roo/core_enum.php'",
54 "xtype": "JsonReader",
55 "totalProperty": "total",
59 "|fields": "[\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'etype',\n 'type': 'string'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'active',\n 'type': 'int'\n },\n {\n 'name': 'seqid',\n 'type': 'int'\n }\n]"
65 "xtype": "PagingToolbar",
68 "displayMsg": "Displaying core_enum{0} - {1} of {2}",
69 "emptyMsg": "No core_enum found",
84 "render": "function (_self)\n{\n _this.etypeCombo = _self;\n}",
85 "select": "function (combo, record, index)\n{\n _this.grid.footer.onClick('first');\n}"
88 "displayField": "name",
90 "emptyText": "Select type",
91 "fieldLabel": "core_enum",
92 "forceSelection": true,
94 "loadingText": "Searching...",
97 "qtip": "Select type",
98 "queryParam": "query[name]",
99 "selectOnFocus": true,
100 "tpl": "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
101 "triggerAction": "all",
103 "valueField": "name",
110 "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n o.params['query[empty_etype]'] = 1;\n}\n"
115 "|sortInfo": "{ direction : 'ASC', field: 'id' }",
120 "xtype": "HttpProxy",
123 "|url": "baseURL + '/Roo/core_enum.php'"
127 "xtype": "JsonReader",
131 "totalProperty": "total",
132 "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"etype\",\"type\":\"string\"}]"
140 "|click": "function()\n{\n \n // if we do not have a selected type... - what should we show..?\n var et = _this.etypeCombo.getValue()\n var ds = _this.grid.getDataSource();\n\n var add = ds.reader.newRow({ id: 0, name : '', etype: et, active: 0, seqid: 0 });\n var r = ds.data.length;\n ds.insert(r , add); \n _this.grid.startEditing(r, 1); // name... \n}\n"
142 "cls": "x-btn-text-icon",
145 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
146 "|xns": "Roo.Toolbar"
149 "|xns": "Roo.Toolbar",
154 "|click": "function()\n{\n \n Roo.MessageBox.prompt (\"Create a new Enum type\",\n \"Enter the name for a new enum type, \" + \n \"this is only relivant if you know how it is going to be used\",\n function(btn,txt) {\n if (btn != 'ok') {\n return; \n }\n new Pman.Request({\n url : baseURL + '/Roo/Core_enum.php',\n method : 'POST',\n params : {\n etype : '',\n name : txt,\n active : 1\n }, \n success : function() {\n Roo.MessageBox.alert(\"Created\", \"You can now select it from the type list on the left\");\n }\n });\n \n \n \n \n }\n ); \n \n \n\n}\n"
156 "cls": "x-btn-text-icon",
157 "text": "Add new type",
159 "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
160 "|xns": "Roo.Toolbar"
165 "xtype": "ColumnModel",
169 "|renderer": "function(v) { return String.format('{0}', v); }",
171 "*prop": "colModel[]"
174 "xtype": "ColumnModel",
178 "|renderer": "function(v) { return String.format('{0}', v); }",
180 "*prop": "colModel[]",
184 "xtype": "GridEditor",
189 "xtype": "TextField",
197 "*prop": "colModel[]",
198 "dataIndex": "active",
201 "xtype": "ColumnModel",
202 "|renderer": "function(v) { \n var state = v> 0 ? '-checked' : '';\n\n return '<img class=\"x-grid-check-icon' + state + '\" src=\"' + Roo.BLANK_IMAGE_URL + '\"/>';\n \n }",
206 "*prop": "colModel[]",
207 "dataIndex": "seqid",
210 "xtype": "ColumnModel",
211 "|renderer": "function(v) { return String.format('{0}', v); }",
218 "xtype": "GridEditor",
223 "allowDecimals": false,
224 "allowNegative": true,
225 "decimalPrecision": 0,
226 "xtype": "NumberField",