- "items": [
- {
- "*prop": "grid",
- "xtype": "Grid",
- "autoExpandColumn": "name",
- "loadMask": true,
- "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}",
- "|rowdblclick": "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
- },
- "|xns": "Roo.grid",
- "items": [
- {
- "*prop": "dataSource",
- "xtype": "Store",
- "remoteSort": true,
- "|sortInfo": "{ field : 'name', direction: 'ASC' }",
- "|xns": "Roo.data",
- "items": [
- {
- "*prop": "proxy",
- "xtype": "HttpProxy",
- "method": "GET",
- "|url": "baseURL + '/Roo/Groups.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': 'name',\n 'type': 'string'\n },\n {\n 'name': 'type',\n 'type': 'int'\n },\n {\n 'name': 'leader',\n 'type': 'int'\n },\n {\n 'name': 'leader_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_office_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_name',\n 'type': 'string'\n },\n {\n 'name': 'leader_phone',\n 'type': 'string'\n },\n {\n 'name': 'leader_fax',\n 'type': 'string'\n },\n {\n 'name': 'leader_email',\n 'type': 'string'\n },\n {\n 'name': 'leader_company_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_role',\n 'type': 'string'\n },\n {\n 'name': 'leader_active',\n 'type': 'int'\n },\n {\n 'name': 'leader_remarks',\n 'type': 'string'\n },\n {\n 'name': 'leader_passwd',\n 'type': 'string'\n },\n {\n 'name': 'leader_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'leader_lang',\n 'type': 'string'\n },\n {\n 'name': 'leader_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'leader_action_type',\n 'type': 'string'\n },\n {\n 'name': 'leader_project_id',\n 'type': 'int'\n }\n]"
- }
- ]
- },
- {
- "*prop": "toolbar",
- "xtype": "Toolbar",
- "|xns": "Roo",
- "items": [
- {
- "text": "Manage Groups",
- "xtype": "Button",
- "|xns": "Roo.Toolbar",
- "items": [
- {
- "|xns": "Roo.menu",
- "xtype": "Menu",
- "*prop": "menu",
- "items": [
- {
- "listeners": {
- "|click": "function()\n{\n if (!_this.dialog) return;\n _this.dialog.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n"
- },
- "cls": "x-btn-text-icon",
- "text": "Add",
- "xtype": "Item",
- "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
- "|xns": "Roo.menu"
- },
- {
- "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 if (!_this.dialog) return;\n _this.dialog.show(s[0].data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n}\n"
- },
- "cls": "x-btn-text-icon",
- "text": "Edit",
- "xtype": "Item",
- "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
- "|xns": "Roo.menu"
- },
- {
- "listeners": {
- "|click": "function()\n{\n Pman.genericDelete(_this, 'Groups'); \n}\n "
- },
- "cls": "x-btn-text-icon",
- "text": "Delete",
- "xtype": "Item",
- "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
- "|xns": "Roo.menu"
- },
- {
- "|xns": "Roo.menu",
- "xtype": "Separator"
- },
- {
- "|xns": "Roo.menu",
- "xtype": "Item"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "xtype": "ColumnModel",
- "header": "Name",
- "width": 200,
- "dataIndex": "name",
- "|renderer": "function(v) { return String.format('{0}', v); }",
- "|xns": "Roo.grid",
- "*prop": "colModel[]"
- }
- ]
- }
- ]