2 "name" : "Pman.Tab.AdminEnum",
3 "parent" : "Pman.Tab.Admin",
4 "title" : "Pman.Tab.AdminEnum",
5 "path" : "/home/michael/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 var data = {\n active:1,\n display_name:'',\n etype:'',\n name:''\n };\n Pman.Dialog.AdminEnumType.show(data,function(){\n \n _this.egrid.footer.onClick('first');\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}"
147 "background" : false,
150 "title" : "Pulldown Options",
151 "xtype" : "GridPanel",
153 "tableName" : "core_enum",
157 "keypress" : "function (e)\n{\n if(e.keyCode == 13){\n _this.grid.footer.onClick('first');\n }\n}",
158 "beforeedit" : "function (e)\n{\n if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n return false;\n }\n}",
159 "|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}",
160 "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}",
161 "afteredit" : "function (e)\n{\n e.record.commit(); \n}"
163 "autoExpandColumn" : "display_name",
164 "xtype" : "EditorGrid",
167 "$ xns" : "Roo.grid",
172 "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}",
173 "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 options.params['query[search]'] = _this.searchBox.getValue();\n if (!options.params.etype.length) {\n return false;\n }\n}"
177 "$ sortInfo" : "{ field : 'etype', direction: 'ASC' }",
178 "$ xns" : "Roo.data",
179 "* prop" : "dataSource",
182 "$ url" : "baseURL + '/Roo/core_enum.php'",
184 "xtype" : "HttpProxy",
185 "$ xns" : "Roo.data",
191 "xtype" : "JsonReader",
192 "$ xns" : "Roo.data",
193 "$ 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]",
195 "totalProperty" : "total"
201 "xtype" : "PagingToolbar",
202 "emptyMsg" : "No core_enum found",
204 "displayInfo" : true,
205 "displayMsg" : "Displaying core_enum{0} - {1} of {2}",
210 "click" : "function (_self, e)\n{\n new Pman.Download({\n grid : _this.grid\n });\n Roo.MessageBox.alert(\"Downloading\", \"File is downloading\");\n}"
214 "$ xns" : "Roo.Toolbar"
218 "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}"
220 "text" : "Upload Values",
222 "$ xns" : "Roo.Toolbar"
229 "* prop" : "toolbar",
233 "|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"
235 "text" : "Add Value",
237 "cls" : "x-btn-text-icon",
238 "$ icon" : "baseURL + '/Pman/templates/images/search.gif'",
239 "$ xns" : "Roo.Toolbar"
243 "|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"
245 "text" : "Add Image",
247 "cls" : "x-btn-text-icon",
248 "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
249 "$ xns" : "Roo.Toolbar"
253 "render" : "function (_self)\n{\n _this.searchBox = this;\n}"
255 "String name" : "search",
256 "xtype" : "TextField",
257 "String fieldLabel" : "Search",
262 "click" : "function (_self, e)\n{\n _this.grid.footer.onClick('first');\n}"
264 "String cls" : "x-btn-icon",
266 "$ xns" : "Roo.Toolbar",
267 "$ icon" : "rootURL + '/Pman/templates/images/search.gif'"
271 "click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}"
273 "String cls" : "x-btn-icon",
275 "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'",
276 "$ xns" : "Roo.Toolbar"
281 "xtype" : "ColumnModel",
283 "header" : "Internal #",
284 "$ renderer" : "function(v) { return String.format('{0}', v); }",
285 "$ xns" : "Roo.grid",
286 "Boolean sortable" : true,
287 "* prop" : "colModel[]",
291 "xtype" : "ColumnModel",
294 "$ 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); }",
295 "$ xns" : "Roo.grid",
296 "* prop" : "colModel[]",
297 "dataIndex" : "images_id_id"
300 "xtype" : "ColumnModel",
303 "$ renderer" : "function(v) { return String.format('{0}', v); }",
304 "$ xns" : "Roo.grid",
305 "Boolean sortable" : true,
306 "* prop" : "colModel[]",
307 "dataIndex" : "name",
310 "xtype" : "GridEditor",
311 "$ xns" : "Roo.grid",
315 "xtype" : "TextField",
316 "$ xns" : "Roo.form",
324 "xtype" : "ColumnModel",
326 "header" : "Display Name",
327 "$ renderer" : "function(v) { return String.format('{0}', v); }",
328 "$ xns" : "Roo.grid",
329 "Boolean sortable" : true,
330 "* prop" : "colModel[]",
331 "dataIndex" : "display_name",
334 "xtype" : "GridEditor",
335 "$ xns" : "Roo.grid",
339 "xtype" : "TextField",
340 "$ xns" : "Roo.form",
348 "xtype" : "ColumnModel",
351 "$ 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 }",
352 "$ xns" : "Roo.grid",
353 "Boolean sortable" : true,
354 "* prop" : "colModel[]",
355 "dataIndex" : "active"
358 "xtype" : "ColumnModel",
360 "header" : "Order #",
362 "$ renderer" : "function(v) { return String.format('{0}', v); }",
363 "$ xns" : "Roo.grid",
364 "Boolean sortable" : true,
365 "* prop" : "colModel[]",
366 "dataIndex" : "seqid",
369 "xtype" : "GridEditor",
370 "$ xns" : "Roo.grid",
374 "allowNegative" : true,
375 "xtype" : "NumberField",
376 "allowDecimals" : false,
377 "decimalPrecision" : 0,
378 "$ xns" : "Roo.form",