2 "name" : "Pman.Tab.AdminEnum",
3 "parent" : "Pman.Tab.Admin",
4 "title" : "Pman.Tab.AdminEnum",
5 "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminEnum.bjs",
10 "xtype" : "NestedLayoutPanel",
12 "String region" : "center",
13 "String title" : "Pulldown Options",
16 "xtype" : "BorderLayout",
22 "xtype" : "LayoutRegion",
25 "Boolean split" : true
28 "xtype" : "LayoutRegion",
34 "|activate" : "function() {\n _this.epanel = this;\n if (_this.egrid) {\n _this.egrid.footer.onClick('first');\n }\n}"
38 "title" : "Pulldown Options",
39 "xtype" : "GridPanel",
41 "tableName" : "core_enum",
45 "beforeedit" : "function (e)\n{\n if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n return false;\n }\n}",
46 "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}",
47 "|render" : "function() \n{\n _this.egrid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.epanel.active) {\n this.footer.onClick('first');\n }\n}",
48 "celldblclick" : "function (_self, rowIndex, columnIndex, e)\n{\n var rec = _this.egrid.ds.getAt(rowIndex);\n Pman.Dialog.AdminEnumType.show(rec.data,function(){\n \n _this.egrid.footer.onClick('first');\n });\n}",
49 "afteredit" : "function (e)\n{\n e.record.commit(); \n}"
51 "autoExpandColumn" : "display_name",
52 "xtype" : "EditorGrid",
60 "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.grid.ds.getById(record.id).data.etype,\n name : record.data.name,\n active : record.data.active,\n seqid : record.data.seqid,\n display_name : record.data.display_name\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}",
61 "beforeload" : "function (_self, o)\n{\n o.params['query[empty_etype]'] = 1; \n \n}"
65 "$ sortInfo" : "{ field : 'etype', direction: 'ASC' }",
67 "* prop" : "dataSource",
70 "$ url" : "baseURL + '/Roo/core_enum.php'",
71 "xtype" : "HttpProxy",
79 "xtype" : "JsonReader",
81 "$ 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]",
83 "totalProperty" : "total"
89 "selectionchange" : "function (_self, selection)\n{\n _this.grid.footer.onClick('first');\n}"
91 "xtype" : "CellSelectionModel",
97 "xtype" : "PagingToolbar",
98 "emptyMsg" : "No core_enum found",
100 "displayInfo" : false,
107 "* prop" : "toolbar",
111 "|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"
113 "text" : "Add new pulldown list",
115 "cls" : "x-btn-text-icon",
116 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
117 "$ xns" : "Roo.Toolbar"
122 "xtype" : "ColumnModel",
123 "header" : "Pulldown",
125 "$ renderer" : "function(v,x,r) { \n\n\n return String.format('<span qtip=\"{1}\">{0}</span>', (''+v).length ? v : r.data.name, r.data.name); \n}",
126 "$ xns" : "Roo.grid",
127 "* prop" : "colModel[]",
128 "dataIndex" : "display_name"
131 "xtype" : "ColumnModel",
134 "$ 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 }",
135 "$ xns" : "Roo.grid",
136 "* prop" : "colModel[]",
137 "dataIndex" : "active"
145 "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}"
148 "background" : false,
150 "title" : "Pulldown Options",
151 "xtype" : "GridPanel",
153 "tableName" : "core_enum",
157 "beforeedit" : "function (e)\n{\n if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n return false;\n }\n}",
158 "|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}",
159 "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}",
160 "afteredit" : "function (e)\n{\n e.record.commit(); \n}"
162 "autoExpandColumn" : "display_name",
163 "xtype" : "EditorGrid",
166 "$ xns" : "Roo.grid",
171 "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.grid.ds.getById(record.id).data.etype,\n name : record.data.name,\n active : record.data.active,\n seqid : record.data.seqid,\n display_name : record.data.display_name\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}",
172 "beforeload" : "function (_self, options)\n{\n\n var s = _this.egrid.getSelectionModel().getSelectedCell();\n \n\n if (!s) {\n return false;\n }\n var d = _this.egrid.dataSource.getAt(s[0]);\n \n options.params.etype = d.data.name;\n if (!options.params.etype.length) {\n return false;\n }\n}"
176 "$ sortInfo" : "{ field : 'etype', direction: 'ASC' }",
177 "$ xns" : "Roo.data",
178 "* prop" : "dataSource",
181 "$ url" : "baseURL + '/Roo/core_enum.php'",
183 "xtype" : "HttpProxy",
184 "$ xns" : "Roo.data",
190 "xtype" : "JsonReader",
191 "$ xns" : "Roo.data",
192 "$ 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]",
194 "totalProperty" : "total"
200 "xtype" : "PagingToolbar",
201 "emptyMsg" : "No core_enum found",
203 "displayInfo" : true,
204 "displayMsg" : "Displaying core_enum{0} - {1} of {2}",
209 "click" : "function (_self, e)\n{\n new Pman.Download({\n grid : _this.grid\n });\n Roo.MessageBox.alert(\"Downloading\", \"File is downloading\");\n}"
213 "$ xns" : "Roo.Toolbar"
217 "click" : "function (_self, e)\n{\n\n var s = _this.egrid.getSelectionModel().getSelectedCell();\n \n\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select a pulldown\");\n }\n \n var d = _this.egrid.dataSource.getAt(s[0]);\n \n\n var etype = d.data.name;\n \n if(!etype.length){\n Roo.MessageBox.alert('Error', 'Please select a pulldown');\n return;\n }\n \n Pman.Dialog.Image.show(\n {\n _url : baseURL+'/Admin/Import/Enum?' + Roo.urlEncode({'etype' : etype})\n \n },\n function () {\n _this.grid.footer.onClick('first');\n }\n );\n}"
219 "text" : "Upload Values",
221 "$ xns" : "Roo.Toolbar"
228 "* prop" : "toolbar",
232 "|click" : "function()\n{\n \n // if we do not have a selected type... - what should we show..?\n \n \n var s = _this.egrid.getSelectionModel().getSelectedCell();\n \n\n if (!s) {\n Roo.MessageBox.alert(\"Error\", \"Select a pulldown\");\n }\n \n var d = _this.egrid.dataSource.getAt(s[0]);\n \n\n var ds = _this.grid.getDataSource();\n\n var add = ds.reader.newRow({ \n id: 0, \n display_name : '', \n name : '', \n etype: d.data.name, \n active: 1, \n seqid: 0\n });\n var r = ds.data.length;\n ds.insert(r , add); \n _this.grid.startEditing(r, 1); // name... \n}\n"
234 "text" : "Add Value",
236 "cls" : "x-btn-text-icon",
237 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
238 "$ xns" : "Roo.Toolbar"
242 "|click" : "function()\n{\n \n // if we do not have a selected type... - what should we show..?\n var et = _this.etypeCombo.getValue();\n \n if (!et) {\n Roo.MessageBox.alert(\"Error\", \"Select a pulldown\");\n return;\n }\n var sc = _this.grid.getSelectionModel().getSelectedCell();\n Roo.log(sc);\n var ds = _this.grid.ds.getAt(sc[0]);\n if (!ds) {\n Roo.MessageBox.alert(\"Error\", \"Select enum\");\n return;\n }\n \n Roo.log(ds);\n Pman.Dialog.AdminEnumImages.show({onid:ds.data.id}, function(){\n _this.grid.footer.onClick('first');\n });\n \n}\n"
244 "text" : "Add Image",
246 "cls" : "x-btn-text-icon",
247 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
248 "$ xns" : "Roo.Toolbar"
253 "xtype" : "ColumnModel",
255 "header" : "Internal #",
256 "$ renderer" : "function(v) { return String.format('{0}', v); }",
257 "$ xns" : "Roo.grid",
258 "* prop" : "colModel[]",
262 "xtype" : "ColumnModel",
265 "$ renderer" : "function(v,x,r) { return String.format('<img src=\"{0}/Images/Thumb/25/{1}/{2}\" width=\"25\" height=\"25\">', baseURL, v, r.data.images_id_filename); }",
266 "$ xns" : "Roo.grid",
267 "* prop" : "colModel[]",
268 "dataIndex" : "images_id_id"
271 "xtype" : "ColumnModel",
274 "$ renderer" : "function(v) { return String.format('{0}', v); }",
275 "$ xns" : "Roo.grid",
276 "* prop" : "colModel[]",
277 "dataIndex" : "name",
280 "xtype" : "GridEditor",
281 "$ xns" : "Roo.grid",
285 "xtype" : "TextField",
286 "$ xns" : "Roo.form",
294 "xtype" : "ColumnModel",
296 "header" : "Display Name",
297 "$ renderer" : "function(v) { return String.format('{0}', v); }",
298 "$ xns" : "Roo.grid",
299 "* prop" : "colModel[]",
300 "dataIndex" : "display_name",
303 "xtype" : "GridEditor",
304 "$ xns" : "Roo.grid",
308 "xtype" : "TextField",
309 "$ xns" : "Roo.form",
317 "xtype" : "ColumnModel",
320 "$ 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 }",
321 "$ xns" : "Roo.grid",
322 "* prop" : "colModel[]",
323 "dataIndex" : "active"
326 "xtype" : "ColumnModel",
328 "header" : "Order #",
330 "$ renderer" : "function(v) { return String.format('{0}', v); }",
331 "$ xns" : "Roo.grid",
332 "* prop" : "colModel[]",
333 "dataIndex" : "seqid",
336 "xtype" : "GridEditor",
337 "$ xns" : "Roo.grid",
341 "allowNegative" : true,
342 "xtype" : "NumberField",
343 "allowDecimals" : false,
344 "decimalPrecision" : 0,
345 "$ xns" : "Roo.form",