{ "id": "roo-file-180", "name": "Pman.Dialog.AdminCoreEnum", "parent": "", "title": "", "path": "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminCoreEnum.bjs", "items": [ { "height": 400, "title": "Pulldown Options", "width": 950, "xtype": "LayoutDialog", "|xns": "Roo", "items": [ { "|xns": "Roo", "xtype": "LayoutRegion", "*prop": "center" }, { "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n // _this.grid.footer.onClick('first');\n }\n}" }, "background": false, "fitContainer": true, "fitToframe": true, "region": "center", "tableName": "core_enum", "title": "Pulldown Options", "xtype": "GridPanel", "|xns": "Roo", "items": [ { "listeners": { "|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}", "afteredit": "function (e)\n{\n e.record.commit(); \n}", "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}", "beforeedit": "function (e)\n{\n if(e.field == 'name' && e.record.data.is_system_enum*1 == 1){\n return false;\n }\n}" }, "*prop": "grid", "autoExpandColumn": "display_name", "clicksToEdit": 1, "loadMask": true, "xtype": "EditorGrid", "|xns": "Roo.grid", "items": [ { "listeners": { "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}", "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 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}" }, "*prop": "dataSource", "remoteSort": true, "xtype": "Store", "|sortInfo": "{ field : 'etype', direction: 'ASC' }", "|xns": "Roo.data", "items": [ { "*prop": "proxy", "method": "GET", "xtype": "HttpProxy", "|url": "baseURL + '/Roo/core_enum.php'", "|xns": "Roo.data" }, { "|xns": "Roo.data", "xtype": "JsonReader", "totalProperty": "total", "root": "data", "*prop": "reader", "id": "id", "|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]" } ] }, { "*prop": "footer", "xtype": "PagingToolbar", "pageSize": 25, "displayInfo": true, "displayMsg": "Displaying core_enum{0} - {1} of {2}", "emptyMsg": "No core_enum found", "|xns": "Roo" }, { "*prop": "toolbar", "xtype": "Toolbar", "|xns": "Roo", "items": [ { "listeners": { "|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 if (!et) {\n Roo.MessageBox.alert(\"Error\", \"Select a pulldown\");\n return;\n }\n\n var add = ds.reader.newRow({ \n id: 0, \n display_name : '', \n name : '', \n etype: et, \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" }, "cls": "x-btn-text-icon", "text": "Add Value", "xtype": "Button", "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", "|xns": "Roo.Toolbar" }, { "|xns": "Roo.Toolbar", "xtype": "Fill" } ] }, { "*prop": "colModel[]", "dataIndex": "id", "header": "Internal #", "width": 75, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "images_id_id", "header": "Image", "width": 75, "xtype": "ColumnModel", "|renderer": "function(v,x,r) { return String.format('', baseURL, v, r.data.images_id_filename); }", "|xns": "Roo.grid" }, { "xtype": "ColumnModel", "header": "Name", "width": 200, "dataIndex": "name", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid", "*prop": "colModel[]", "items": [ { "|xns": "Roo.grid", "xtype": "GridEditor", "*prop": "editor", "items": [ { "|xns": "Roo.form", "xtype": "TextField", "*prop": "field" } ] } ] }, { "*prop": "colModel[]", "dataIndex": "display_name", "header": "Display Name", "width": 200, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid", "items": [ { "|xns": "Roo.grid", "xtype": "GridEditor", "*prop": "editor", "items": [ { "|xns": "Roo.form", "xtype": "TextField", "*prop": "field" } ] } ] }, { "*prop": "colModel[]", "dataIndex": "active", "header": "Active", "width": 75, "xtype": "ColumnModel", "|renderer": "function(v) { \n var state = v> 0 ? '-checked' : '';\n\n return '';\n \n }", "|xns": "Roo.grid" }, { "*prop": "colModel[]", "dataIndex": "seqid", "header": "Order #", "sortable": true, "width": 75, "xtype": "ColumnModel", "|renderer": "function(v) { return String.format('{0}', v); }", "|xns": "Roo.grid", "items": [ { "|xns": "Roo.grid", "xtype": "GridEditor", "*prop": "editor", "items": [ { "*prop": "field", "allowDecimals": false, "allowNegative": true, "decimalPrecision": 0, "xtype": "NumberField", "|xns": "Roo.form" } ] } ] } ] } ] }, { "*prop": "buttons[]", "text": "OK", "xtype": "Button", "|xns": "Roo" } ] } ], "permname": "", "modOrder": "001" }