{ "id": "roo-file-271", "name": "Pman.Dialog.CmsCategory", "parent": "", "title": "Cms - Category Edit", "path": "/home/edward/gitlive/Pman.Cms/Pman.Dialog.CmsCategory.bjs", "items": [ { "xtype": "LayoutDialog", "|xns": "Roo", "background": true, "width": 800, "height": 500, "title": "Edit Category", "modal": true, "resizable": false, "collapsible": false, "closable": false, "listeners": {}, "items": [ { "xtype": "LayoutRegion", "*prop": "center", "titlebar": false, "listeners": {}, "|xns": "Roo" }, { "xtype": "LayoutRegion", "*prop": "east", "titlebar": false, "split": "true", "fitToFrame": "true", "width": 200, "listeners": {}, "|xns": "Roo" }, { "xtype": "ContentPanel", "background": true, "fitToFrame": true, "region": "center", "listeners": {}, "|xns": "Roo", "items": [ { "listeners": { "|actionfailed": "function (_self, action)\n{\n _this.dialog.el.unmask();\n Pman.standardActionFailed(_self, action);\n}\n", "|actioncomplete": "function (_self, action)\n{\n \n if (action.type =='submit') {\n \n _this.dialog.el.unmask();\n _this.dialog.hide();\n \n if (_this.callback) {\n _this.callback.call(_this, _this.form.getValues());\n }\n _this.form.reset();\n return;\n }\n if (action.type == 'setdata') {\n if (_this.data.id) {\n _this.dialog.el.mask(\"Loading\");\n this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n return;\n }\n _this.grid.getDataSource().load();\n return;\n }\n if (action.type == 'load') {\n _this.grid.getDataSource().load();\n _this.dialog.el.unmask();\n return;\n }\n \n \n \n}\n", "|rendered": "function (_self)\n{\n _this.form = _self;\n}\n" }, "method": "POST", "style": "margin: 5px", "xtype": "Form", "|url": "baseURL + '/Roo/Category.php'", "|xns": "Roo.form", "items": [ { "fieldLabel": "Parent", "name": "parent_id_title", "readOnly": true, "width": 450, "xtype": "TextField", "|xns": "Roo.form" }, { "decimalPrecision": 0, "fieldLabel": "Order (1 first)", "name": "display_order", "width": 50, "xtype": "NumberField", "|xns": "Roo.form" }, { "name": "title", "fieldLabel": "Title", "width": 450, "xtype": "TextField", "listeners": {}, "|xns": "Roo.form" }, { "allowBlank": true, "displayField": "name", "editable": "false", "emptyText": "Select Type", "fieldLabel": "Type", "forceSelection": true, "hiddenName": "category_type_id", "listWidth": 200, "loadingText": "Searching...", "minChars": 2, "name": "category_type_id_name", "pageSize": 20, "qtip": "Select cms_category_type", "selectOnFocus": true, "tpl": "
{name}
", "triggerAction": "all", "typeAhead": true, "valueField": "id", "width": 200, "xtype": "ComboBox", "|xns": "Roo.form", "items": [ { "*prop": "store", "xtype": "Store", "|xns": "Roo.data", "remoteSort": true, "|sortInfo": "{ direction : 'ASC', field: 'id' }", "listeners": { "|beforeload": "function (_self, o){\n o.params = o.params || {};\n // set more here\n}\n" }, "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|xns": "Roo.data", "|url": "baseURL + '/Roo/cms_category_type.php'" }, { "*prop": "reader", "xtype": "JsonReader", "|xns": "Roo.data", "id": "id", "root": "data", "totalProperty": "total", "|fields": "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]" } ] } ] }, { "fieldLabel": "Visible", "name": "visible", "xtype": "Checkbox", "|xns": "Roo.form" }, { "name": "parent_id", "xtype": "Hidden", "|xns": "Roo.form" }, { "name": "id", "xtype": "Hidden", "listeners": {}, "|xns": "Roo.form" } ] } ] }, { "xtype": "GridPanel", "title": "Images", "fitToframe": true, "fitContainer": true, "tableName": "Images", "background": false, "listeners": { "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n //_this.grid.footer.onClick('first');\n }\n}" }, "region": "east", "|xns": "Roo", "items": [ { "*prop": "grid", "xtype": "Grid", "autoExpandColumn": "filename", "loadMask": true, "listeners": { "|render": "function() { \n _this.grid = this; \n //_this.dialog = Pman.Dialog.FILL_IN\n if (_this.panel.active) {\n //this.footer.onClick('first');\n }\n}" }, "|xns": "Roo.grid", "items": [ { "*prop": "dataSource", "xtype": "Store", "|reader": "Pman.Readers.Images", "listeners": { "|beforeload": "function (_self, o)\n{\n if (!_this.data.id) {\n return false;\n } \n o.params = o.params || {};\n o.params.onid = _this.data.id;\n o.params.ontable = 'Category';\n}" }, "|xns": "Roo.data", "items": [ { "*prop": "proxy", "xtype": "HttpProxy", "method": "GET", "|url": "baseURL + '/Roo/Images.php'", "listeners": {}, "|xns": "Roo.data" } ] }, { "*prop": "toolbar", "xtype": "Toolbar", "listeners": {}, "|xns": "Roo", "items": [ { "text": "Add", "xtype": "Button", "cls": "x-btn-text-icon", "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", "listeners": { "|click": "function()\n {\n Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'Category' }, function(data) {\n _this.grid.getDataSource().load();\n Pman.Dialog.CmsImage.show(data, function() {\n _this.grid.getDataSource().load();\n }); \n \n \n }); \n\n }\n " }, "|xns": "Roo" }, { "text": "Edit", "xtype": "Button", "cls": "x-btn-text-icon", "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'", "listeners": { "|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 var data = _this.grid.getDataSource().getById(s[0].data.id).data;\n Pman.Dialog.CmsImage.show(data, function() {\n _this.grid.getDataSource().load();\n }); \n \n }\n " }, "|xns": "Roo" }, { "text": "Delete", "cls": "x-btn-text-icon", "|icon": "rootURL + '/Pman/templates/images/trash.gif'", "xtype": "Button", "listeners": { "|click": "function()\n {\n Pman.genericDelete(_this, _this.panel.tableName); \n }\n " }, "|xns": "Roo" } ] }, { "*prop": "colModel[]", "dataIndex": "id", "header": "", "width": 110, "xtype": "ColumnModel", "|renderer": "function(v,x,r) { return String.format('', baseURL, v, r.data.filename); }", "|xns": "Roo.grid" }, { "xtype": "ColumnModel", "header": "Filename", "width": 100, "dataIndex": "filename", "|renderer": "function(v,x,r) { return String.format('{0}
{1}', v, r.data.linkurl); }", "listeners": {}, "|xns": "Roo.grid", "*prop": "colModel[]" } ] } ] }, { "text": "Cancel", "xtype": "Button", "|xns": "Roo", "listeners": { "|click": " function() {\n\n _this.form.reset();\n\n _this.dialog.hide();\n\n }\n" }, "*prop": "buttons[]" }, { "text": "OK", "xtype": "Button", "|xns": "Roo", "listeners": { "|click": " function() {\n\n _this.dialog.el.mask(\"Saving\");\n\n _this.form.doAction(\"submit\");\n\n }\n" }, "*prop": "buttons[]" } ] } ], "permname": "", "modOrder": "001" }