From 837fda741ef8256ef20e9eef323936f104acaae5 Mon Sep 17 00:00:00 2001 From: Micheal Date: Thu, 29 Jan 2015 15:29:11 +0800 Subject: [PATCH] Pman.Tab.AdminCompanies.bjs Pman.Tab.AdminCompanies.js --- Pman.Tab.AdminCompanies.bjs | 367 ++++++++++++----------- Pman.Tab.AdminCompanies.js | 579 +++++++++++++++++++----------------- 2 files changed, 495 insertions(+), 451 deletions(-) diff --git a/Pman.Tab.AdminCompanies.bjs b/Pman.Tab.AdminCompanies.bjs index f576b9e..658d432 100644 --- a/Pman.Tab.AdminCompanies.bjs +++ b/Pman.Tab.AdminCompanies.bjs @@ -1,244 +1,245 @@ { - "id": "roo-file-88", - "name": "Pman.Tab.AdminCompanies", - "parent": "Pman.Tab.Admin", - "title": "Pman.Tab.AdminCompanies", - "path": "/home/edward/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs", - "items": [ + "name" : "Pman.Tab.AdminCompanies", + "parent" : "Pman.Tab.Admin", + "title" : "Pman.Tab.AdminCompanies", + "path" : "/home/michael/gitlive/Pman.Admin/Pman.Tab.AdminCompanies.bjs", + "permname" : "Admin.Companies", + "modOrder" : "030", + "items" : [ { - "region": "center", - "title": "Companies", - "xtype": "NestedLayoutPanel", - "|xns": "Roo", - "items": [ + "region" : "center", + "xtype" : "NestedLayoutPanel", + "title" : "Companies", + "$ xns" : "Roo", + "items" : [ { - "|xns": "Roo", - "xtype": "BorderLayout", - "*prop": "layout", - "items": [ + "xtype" : "BorderLayout", + "$ xns" : "Roo", + "* prop" : "layout", + "items" : [ { - "|xns": "Roo", - "xtype": "LayoutRegion", - "*prop": "center" + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "* prop" : "center" }, { - "*prop": "south", - "height": 150, - "split": true, - "titlebar": true, - "xtype": "LayoutRegion", - "|xns": "Roo" + "xtype" : "LayoutRegion", + "$ xns" : "Roo", + "split" : true, + "* prop" : "south", + "height" : 150, + "titlebar" : true }, { - "listeners": { - "|activate": "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" + "listeners" : { + "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, - "background": true, - "fitContainer": true, - "fitToframe": true, - "region": "center", - "tableName": "Companies", - "title": "Companies", - "xtype": "GridPanel", - "|xns": "Roo", - "items": [ + "fitToframe" : true, + "background" : true, + "region" : "center", + "title" : "Companies", + "xtype" : "GridPanel", + "fitContainer" : true, + "$ xns" : "Roo", + "tableName" : "Companies", + "items" : [ { - "listeners": { - "|render": "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.Companies;\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).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n \n}\n", - "rowclick": "function (_self, rowIndex, e)\n{\n try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {}\n}" + "listeners" : { + "|rowdblclick" : "function (_self, rowIndex, e)\n{\n if (!_this.dialog) return;\n _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n _this.grid.footer.onClick('first');\n }); \n \n \n}\n", + "|render" : "function() \n{\n _this.grid = this; \n _this.dialog = Pman.Dialog.Companies;\n if (_this.panel.active) {\n this.footer.onClick('first');\n }\n}", + "rowclick" : "function (_self, rowIndex, e)\n{\n try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {}\n}" }, - "*prop": "grid", - "autoExpandColumn": "name", - "loadMask": true, - "xtype": "Grid", - "|xns": "Roo.grid", - "items": [ + "autoExpandColumn" : "name", + "xtype" : "Grid", + "loadMask" : true, + "$ xns" : "Roo.grid", + "* prop" : "grid", + "items" : [ { - "listeners": { - "load": "function (_self, records, options)\n{\n try {\n Pman.Tab.AdminOffice.grid.footer.onClick('refresh');\n } catch (e) {}\n}", - "beforeload": "function (_self, o)\n{\n o.params = o.params || {};\n try {\n o.params['query[name]'] = _this.searchBox.getValue();\n } catch(e) { return false; }\n}" + "listeners" : { + "beforeload" : "function (_self, o)\n{\n o.params = o.params || {};\n try {\n o.params['query[name]'] = _this.searchBox.getValue();\n } catch(e) { return false; }\n}", + "load" : "function (_self, records, options)\n{\n try {\n Pman.Tab.AdminOffice.grid.footer.onClick('refresh');\n } catch (e) {}\n}" }, - "*prop": "dataSource", - "remoteSort": true, - "xtype": "Store", - "|sortInfo": "{ field : 'name', direction: 'ASC' }", - "|xns": "Roo.data", - "items": [ + "xtype" : "Store", + "remoteSort" : true, + "$ sortInfo" : "{ field : 'name', direction: 'ASC' }", + "$ xns" : "Roo.data", + "* prop" : "dataSource", + "items" : [ { - "listeners": { - "load": "function (This, o, arg)\n{\n \n}" + "listeners" : { + "load" : "function (This, o, arg)\n{\n \n}" }, - "*prop": "proxy", - "method": "GET", - "xtype": "HttpProxy", - "|url": "baseURL + '/Roo/Companies.php'", - "|xns": "Roo.data" + "$ url" : "baseURL + '/Roo/Companies.php'", + "xtype" : "HttpProxy", + "method" : "GET", + "$ xns" : "Roo.data", + "* prop" : "proxy" }, { - "|xns": "Roo.data", - "xtype": "JsonReader", - "totalProperty": "total", - "root": "data", - "*prop": "reader", - "id": "id", - "|fields": "[\n {\n 'name': 'code',\n 'type': 'string'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'address',\n 'type': 'string'\n },\n {\n 'name': 'tel',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'isOwner',\n 'type': 'int'\n },\n {\n 'name': 'logo_id',\n 'type': 'int'\n },\n {\n 'name': 'background_color',\n 'type': 'string'\n },\n {\n 'name': 'comptype',\n 'type': 'string'\n },\n {\n 'name': 'url',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'created_by',\n 'type': 'int'\n },\n {\n 'name': 'created_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'updated_by',\n 'type': 'int'\n },\n {\n 'name': 'updated_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'dispatch_port',\n 'type': 'string'\n },\n {\n 'name': 'province',\n 'type': 'string'\n },\n {\n 'name': 'country',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filename',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_ontable',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_onid',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_mimetype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_width',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_height',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filesize',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_displayorder',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_language',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_parent_image_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_created',\n 'type': 'date'\n },\n {\n 'name': 'logo_id_imgtype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_linkurl',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_descript',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_title',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'main_office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_role',\n 'type': 'string'\n }\n]" + "id" : "id", + "root" : "data", + "xtype" : "JsonReader", + "$ xns" : "Roo.data", + "$ fields" : "[\n {\n 'name': 'code',\n 'type': 'string'\n },\n {\n 'name': 'name',\n 'type': 'string'\n },\n {\n 'name': 'remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id',\n 'type': 'int'\n },\n {\n 'name': 'address',\n 'type': 'string'\n },\n {\n 'name': 'tel',\n 'type': 'string'\n },\n {\n 'name': 'fax',\n 'type': 'string'\n },\n {\n 'name': 'email',\n 'type': 'string'\n },\n {\n 'name': 'id',\n 'type': 'int'\n },\n {\n 'name': 'isOwner',\n 'type': 'int'\n },\n {\n 'name': 'logo_id',\n 'type': 'int'\n },\n {\n 'name': 'background_color',\n 'type': 'string'\n },\n {\n 'name': 'comptype',\n 'type': 'string'\n },\n {\n 'name': 'url',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id',\n 'type': 'int'\n },\n {\n 'name': 'created_by',\n 'type': 'int'\n },\n {\n 'name': 'created_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'updated_by',\n 'type': 'int'\n },\n {\n 'name': 'updated_dt',\n 'type': 'date',\n 'dateFormat': 'Y-m-d'\n },\n {\n 'name': 'passwd',\n 'type': 'string'\n },\n {\n 'name': 'dispatch_port',\n 'type': 'string'\n },\n {\n 'name': 'province',\n 'type': 'string'\n },\n {\n 'name': 'country',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filename',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_ontable',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_onid',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_mimetype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_width',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_height',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_filesize',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_displayorder',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_language',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_parent_image_id',\n 'type': 'int'\n },\n {\n 'name': 'logo_id_created',\n 'type': 'date'\n },\n {\n 'name': 'logo_id_imgtype',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_linkurl',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_descript',\n 'type': 'string'\n },\n {\n 'name': 'logo_id_title',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_office_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_name',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_email',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_role',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_active',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_remarks',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_passwd',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_owner_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_lang',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_no_reset_sent',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_action_type',\n 'type': 'string'\n },\n {\n 'name': 'owner_id_project_id',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_by',\n 'type': 'int'\n },\n {\n 'name': 'owner_id_deleted_dt',\n 'type': 'date'\n },\n {\n 'name': 'main_office_id_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_company_id',\n 'type': 'int'\n },\n {\n 'name': 'main_office_id_name',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_address',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_phone',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_fax',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_email',\n 'type': 'string'\n },\n {\n 'name': 'main_office_id_role',\n 'type': 'string'\n }\n]", + "* prop" : "reader", + "totalProperty" : "total" } ] }, { - "*prop": "footer", - "xtype": "PagingToolbar", - "pageSize": 25, - "displayInfo": true, - "displayMsg": "Displaying Companies{0} - {1} of {2}", - "emptyMsg": "No Companies found", - "|xns": "Roo" + "pageSize" : 25, + "xtype" : "PagingToolbar", + "emptyMsg" : "No Companies found", + "$ xns" : "Roo", + "displayInfo" : true, + "displayMsg" : "Displaying Companies{0} - {1} of {2}", + "* prop" : "footer" }, { - "*prop": "toolbar", - "xtype": "Toolbar", - "|xns": "Roo", - "items": [ + "xtype" : "Toolbar", + "$ xns" : "Roo", + "* prop" : "toolbar", + "items" : [ { - "listeners": { - "show": "function (_self)\n{\n\n}", - "specialkey": "function (_self, e)\n{\n if (e.getKey() == 13) {\n _this.grid.footer.onClick( 'first' );\n }\n}", - "render": "function (_self)\n{\n_this.searchBox = _self;\n}" + "listeners" : { + "specialkey" : "function (_self, e)\n{\n if (e.getKey() == 13) {\n _this.grid.footer.onClick( 'first' );\n }\n}", + "show" : "function (_self)\n{\n\n}", + "render" : "function (_self)\n{\n_this.searchBox = _self;\n}" }, - "xtype": "TextField", - "|xns": "Roo.form" + "xtype" : "TextField", + "$ xns" : "Roo.form" }, { - "listeners": { - "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" + "listeners" : { + "|click" : "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}" }, - "cls": "x-btn-icon", - "xtype": "Button", - "|icon": "rootURL + '/Pman/templates/images/search.gif'", - "|xns": "Roo.Toolbar" + "xtype" : "Button", + "cls" : "x-btn-icon", + "$ icon" : "rootURL + '/Pman/templates/images/search.gif'", + "$ xns" : "Roo.Toolbar" }, { - "listeners": { - "|click": "function (_self, e)\n{\n _this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}" + "listeners" : { + "|click" : "function (_self, e)\n{\n _this.searchBox.setValue('');\n _this.grid.footer.onClick('first');\n}" }, - "cls": "x-btn-icon", - "xtype": "Button", - "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'", - "|xns": "Roo.Toolbar" + "xtype" : "Button", + "cls" : "x-btn-icon", + "$ icon" : "rootURL + '/Pman/templates/images/edit-clear.gif'", + "$ xns" : "Roo.Toolbar" }, { - "|xns": "Roo.Toolbar", - "xtype": "Fill" + "xtype" : "Fill", + "$ xns" : "Roo.Toolbar" }, { - "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" + "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": "Button", - "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'", - "|xns": "Roo.Toolbar" + "text" : "Add", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'", + "$ xns" : "Roo.Toolbar" }, { - "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" + "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": "Button", - "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'", - "|xns": "Roo.Toolbar" + "text" : "Edit", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "Roo.rootURL + 'images/default/tree/leaf.gif'", + "$ xns" : "Roo.Toolbar" }, { - "text": "Delete", - "cls": "x-btn-text-icon", - "|icon": "rootURL + '/Pman/templates/images/trash.gif'", - "xtype": "Button", - "listeners": { - "|click": "function()\n{\n Pman.genericDelete(_this, 'Companies'); \n}\n " + "listeners" : { + "|click" : "function()\n{\n Pman.genericDelete(_this, 'Companies'); \n}\n " }, - "|xns": "Roo.Toolbar" + "text" : "Delete", + "xtype" : "Button", + "cls" : "x-btn-text-icon", + "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'", + "$ xns" : "Roo.Toolbar" } ] }, { - "*prop": "colModel[]", - "dataIndex": "comptype", - "header": "Type", - "sortable": true, - "width": 90, - "xtype": "ColumnModel", - "|renderer": "function (v,x ,r) {\n //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n return v;\n}", - "|xns": "Roo.grid" + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Type", + "width" : 90, + "$ renderer" : "function (v,x ,r) {\n //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v);\n return v;\n}", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "comptype" }, { - "*prop": "colModel[]", - "dataIndex": "code", - "header": "Ref#", - "sortable": true, - "width": 50, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Ref#", + "width" : 50, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "code" }, { - "*prop": "colModel[]", - "dataIndex": "name", - "header": "Name", - "sortable": true, - "width": 200, - "xtype": "ColumnModel", - "|renderer": "function(v,x,r) {\n return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); \n}", - "|xns": "Roo.grid" + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Name", + "width" : 200, + "$ renderer" : "function(v,x,r) {\n return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); \n}", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "name" }, { - "*prop": "colModel[]", - "dataIndex": "tel", - "header": "Tel", - "width": 100, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" + "xtype" : "ColumnModel", + "header" : "Tel", + "width" : 100, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "tel" }, { - "*prop": "colModel[]", - "dataIndex": "fax", - "header": "Fax", - "width": 100, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" + "xtype" : "ColumnModel", + "header" : "Fax", + "width" : 100, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "fax" }, { - "*prop": "colModel[]", - "dataIndex": "email", - "header": "Email", - "sortable": true, - "width": 100, - "xtype": "ColumnModel", - "|renderer": " function (v) {\n return (v.length && v.indexOf('@') > 0 ) ? \n String.format('{0}',v) : v;\n \n }", - "|xns": "Roo.grid" + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Email", + "width" : 100, + "$ renderer" : " function (v) {\n return (v.length && v.indexOf('@') > 0 ) ? \n String.format('{0}',v) : v;\n \n }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "email" }, { - "*prop": "colModel[]", - "dataIndex": "address", - "header": "Address", - "sortable": true, - "width": 200, - "xtype": "ColumnModel", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid" + "xtype" : "ColumnModel", + "sortable" : true, + "header" : "Address", + "width" : 200, + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "address" }, { - "xtype": "ColumnModel", - "header": "Remarks", - "width": 200, - "dataIndex": "remarks", - "|renderer": "function(v) { return String.format('{0}', v); }", - "|xns": "Roo.grid", - "*prop": "colModel[]" + "xtype" : "ColumnModel", + "width" : 200, + "header" : "Remarks", + "$ renderer" : "function(v) { return String.format('{0}', v); }", + "$ xns" : "Roo.grid", + "* prop" : "colModel[]", + "dataIndex" : "remarks" } ] } @@ -248,7 +249,5 @@ } ] } - ], - "permname": "Admin.Companies", - "modOrder": "030" + ] } \ No newline at end of file diff --git a/Pman.Tab.AdminCompanies.js b/Pman.Tab.AdminCompanies.js index 280dffa..4a7f533 100644 --- a/Pman.Tab.AdminCompanies.js +++ b/Pman.Tab.AdminCompanies.js @@ -2,8 +2,10 @@ // Auto generated file - created by app.Builder.js- do not edit directly (at present!) +Roo.namespace('Pman.Tab'); + Pman.Tab.AdminCompanies = new Roo.XComponent({ - part : ["Admin","Companies"], + part : ["Admin", "Companies" ], order : '030-Pman.Tab.AdminCompanies', region : 'center', parent : 'Pman.Tab.Admin', @@ -15,97 +17,46 @@ Pman.Tab.AdminCompanies = new Roo.XComponent({ var _this = this; var MODULE = this; return { - xtype: 'NestedLayoutPanel', - xns: Roo, - region : 'center', - title : "Companies", layout : { - xtype: 'BorderLayout', - xns: Roo, + center : { + '|xns' : 'Roo', + xtype : 'LayoutRegion', + xns : Roo + }, + south : { + '|xns' : 'Roo', + xtype : 'LayoutRegion', + xns : Roo, + split : true, + height : 150, + titlebar : true + }, + '|xns' : 'Roo', + xtype : 'BorderLayout', + xns : Roo, items : [ - { - xtype: 'GridPanel', - xns: Roo, - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } - } - }, - background : true, - fitContainer : true, - fitToframe : true, - region : 'center', - tableName : 'Companies', - title : "Companies", + { grid : { - xtype: 'Grid', - xns: Roo.grid, - listeners : { - render : function() - { - _this.grid = this; - _this.dialog = Pman.Dialog.Companies; - if (_this.panel.active) { - this.footer.onClick('first'); - } - }, - rowdblclick : function (_self, rowIndex, e) - { - if (!_this.dialog) return; - _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { - _this.grid.footer.onClick('first'); - }); - - - }, - rowclick : function (_self, rowIndex, e) - { - try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {} - } - }, - autoExpandColumn : 'name', - loadMask : true, dataSource : { - xtype: 'Store', - xns: Roo.data, - listeners : { - load : function (_self, records, options) - { - try { - Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); - } catch (e) {} - }, - beforeload : function (_self, o) - { - o.params = o.params || {}; - try { - o.params['query[name]'] = _this.searchBox.getValue(); - } catch(e) { return false; } - } - }, - remoteSort : true, - sortInfo : { field : 'name', direction: 'ASC' }, proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - listeners : { - load : function (This, o, arg) - { - - } - }, + '|xns' : 'Roo.data', + url : baseURL + '/Roo/Companies.php', + xtype : 'HttpProxy', method : 'GET', - url : baseURL + '/Roo/Companies.php' + xns : Roo.data, + listeners : { + load : function (This, o, arg) + { + + } + } }, reader : { - xtype: 'JsonReader', - xns: Roo.data, - totalProperty : 'total', - root : 'data', + '|xns' : 'Roo.data', id : 'id', + root : 'data', + xtype : 'JsonReader', + xns : Roo.data, fields : [ { 'name': 'code', @@ -369,218 +320,312 @@ Pman.Tab.AdminCompanies = new Roo.XComponent({ 'name': 'main_office_id_role', 'type': 'string' } - ] - } + ], + totalProperty : 'total' + }, + '|xns' : 'Roo.data', + xtype : 'Store', + remoteSort : true, + sortInfo : { field : 'name', direction: 'ASC' }, + xns : Roo.data, + listeners : { + beforeload : function (_self, o) + { + o.params = o.params || {}; + try { + o.params['query[name]'] = _this.searchBox.getValue(); + } catch(e) { return false; } + }, + load : function (_self, records, options) + { + try { + Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); + } catch (e) {} + } + }, + items : [ + + ] + }, footer : { - xtype: 'PagingToolbar', - xns: Roo, + '|xns' : 'Roo', pageSize : 25, + xtype : 'PagingToolbar', + emptyMsg : "No Companies found", + xns : Roo, displayInfo : true, - displayMsg : "Displaying Companies{0} - {1} of {2}", - emptyMsg : "No Companies found" + displayMsg : "Displaying Companies{0} - {1} of {2}" }, toolbar : { - xtype: 'Toolbar', - xns: Roo, + '|xns' : 'Roo', + xtype : 'Toolbar', + xns : Roo, items : [ - { - xtype: 'TextField', - xns: Roo.form, + { + '|xns' : 'Roo.form', + xtype : 'TextField', + xns : Roo.form, listeners : { - show : function (_self) - { - - }, - specialkey : function (_self, e) - { - if (e.getKey() == 13) { - _this.grid.footer.onClick( 'first' ); - } - }, - render : function (_self) - { - _this.searchBox = _self; - } + specialkey : function (_self, e) + { + if (e.getKey() == 13) { + _this.grid.footer.onClick( 'first' ); + } + }, + show : function (_self) + { + + }, + render : function (_self) + { + _this.searchBox = _self; + } } }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - click : function (_self, e) - { - _this.grid.footer.onClick('first'); - } - }, + { + '|xns' : 'Roo.Toolbar', + xtype : 'Button', cls : 'x-btn-icon', - icon : rootURL + '/Pman/templates/images/search.gif' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, + icon : rootURL + '/Pman/templates/images/search.gif', + xns : Roo.Toolbar, listeners : { - click : function (_self, e) - { - _this.searchBox.setValue(''); - _this.grid.footer.onClick('first'); - } - }, + click : function (_self, e) + { + _this.grid.footer.onClick('first'); + } + } + }, + { + '|xns' : 'Roo.Toolbar', + xtype : 'Button', cls : 'x-btn-icon', - icon : rootURL + '/Pman/templates/images/edit-clear.gif' + icon : rootURL + '/Pman/templates/images/edit-clear.gif', + xns : Roo.Toolbar, + listeners : { + click : function (_self, e) + { + _this.searchBox.setValue(''); + _this.grid.footer.onClick('first'); + } + } }, - { - xtype: 'Fill', - xns: Roo.Toolbar + { + '|xns' : 'Roo.Toolbar', + xtype : 'Fill', + xns : Roo.Toolbar }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - click : function() - { - if (!_this.dialog) return; - _this.dialog.show( { id : 0 } , function() { - _this.grid.footer.onClick('first'); - }); - } - }, - cls : 'x-btn-text-icon', + { + '|xns' : 'Roo.Toolbar', text : "Add", - icon : Roo.rootURL + 'images/default/dd/drop-add.gif' - }, - { - xtype: 'Button', - xns: Roo.Toolbar, - listeners : { - click : function() - { - var s = _this.grid.getSelectionModel().getSelections(); - if (!s.length || (s.length > 1)) { - Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row"); - return; - } - if (!_this.dialog) return; - _this.dialog.show(s[0].data, function() { - _this.grid.footer.onClick('first'); - }); - - } - }, + xtype : 'Button', cls : 'x-btn-text-icon', + icon : Roo.rootURL + 'images/default/dd/drop-add.gif', + xns : Roo.Toolbar, + listeners : { + click : function() + { + if (!_this.dialog) return; + _this.dialog.show( { id : 0 } , function() { + _this.grid.footer.onClick('first'); + }); + } + } + }, + { + '|xns' : 'Roo.Toolbar', text : "Edit", - icon : Roo.rootURL + 'images/default/tree/leaf.gif' + xtype : 'Button', + cls : 'x-btn-text-icon', + icon : Roo.rootURL + 'images/default/tree/leaf.gif', + xns : Roo.Toolbar, + listeners : { + click : function() + { + var s = _this.grid.getSelectionModel().getSelections(); + if (!s.length || (s.length > 1)) { + Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row"); + return; + } + if (!_this.dialog) return; + _this.dialog.show(s[0].data, function() { + _this.grid.footer.onClick('first'); + }); + + } + } }, - { - xtype: 'Button', - xns: Roo.Toolbar, + { + '|xns' : 'Roo.Toolbar', text : "Delete", + xtype : 'Button', cls : 'x-btn-text-icon', icon : rootURL + '/Pman/templates/images/trash.gif', + xns : Roo.Toolbar, listeners : { - click : function() - { - Pman.genericDelete(_this, 'Companies'); - } + click : function() + { + Pman.genericDelete(_this, 'Companies'); + } } } ] + }, + '|xns' : 'Roo.grid', + autoExpandColumn : 'name', + xtype : 'Grid', + loadMask : true, + xns : Roo.grid, colModel : [ - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'comptype', - header : 'Type', - sortable : true, - width : 90, - renderer : function (v,x ,r) { - //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v); - return v; - } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'code', - header : 'Ref#', - sortable : true, - width : 50, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'name', - header : 'Name', - sortable : true, - width : 200, - renderer : function(v,x,r) { - return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); - } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'tel', - header : 'Tel', - width : 100, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'fax', - header : 'Fax', - width : 100, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'email', - header : 'Email', - sortable : true, - width : 100, - renderer : function (v) { - return (v.length && v.indexOf('@') > 0 ) ? - String.format('{0}',v) : v; - - } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - dataIndex : 'address', - header : 'Address', - sortable : true, - width : 200, - renderer : function(v) { return String.format('{0}', v); } - }, - { - xtype: 'ColumnModel', - xns: Roo.grid, - header : 'Remarks', - width : 200, - dataIndex : 'remarks', - renderer : function(v) { return String.format('{0}', v); } - } + { + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + sortable : true, + header : 'Type', + width : 90, + renderer : function (v,x ,r) { + //return Pman.Dialog.Companies.comptypeListToString(r.data.isOwner ? 'OWNER' : v); + return v; + }, + xns : Roo.grid, + dataIndex : 'comptype' + }, +{ + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + sortable : true, + header : 'Ref#', + width : 50, + renderer : function(v) { return String.format('{0}', v); }, + xns : Roo.grid, + dataIndex : 'code' + }, +{ + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + sortable : true, + header : 'Name', + width : 200, + renderer : function(v,x,r) { + return String.format(r.data.comptype == 'OWNER' ? '{0}' : '{0}',v); + }, + xns : Roo.grid, + dataIndex : 'name' + }, +{ + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + header : 'Tel', + width : 100, + renderer : function(v) { return String.format('{0}', v); }, + xns : Roo.grid, + dataIndex : 'tel' + }, +{ + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + header : 'Fax', + width : 100, + renderer : function(v) { return String.format('{0}', v); }, + xns : Roo.grid, + dataIndex : 'fax' + }, +{ + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + sortable : true, + header : 'Email', + width : 100, + renderer : function (v) { + return (v.length && v.indexOf('@') > 0 ) ? + String.format('{0}',v) : v; + + }, + xns : Roo.grid, + dataIndex : 'email' + }, +{ + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + sortable : true, + header : 'Address', + width : 200, + renderer : function(v) { return String.format('{0}', v); }, + xns : Roo.grid, + dataIndex : 'address' + }, +{ + '|xns' : 'Roo.grid', + xtype : 'ColumnModel', + width : 200, + header : 'Remarks', + renderer : function(v) { return String.format('{0}', v); }, + xns : Roo.grid, + dataIndex : 'remarks' + } + ], + listeners : { + rowdblclick : function (_self, rowIndex, e) + { + if (!_this.dialog) return; + _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() { + _this.grid.footer.onClick('first'); + }); + + + }, + render : function() + { + _this.grid = this; + _this.dialog = Pman.Dialog.Companies; + if (_this.panel.active) { + this.footer.onClick('first'); + } + }, + rowclick : function (_self, rowIndex, e) + { + try { Pman.Tab.AdminOffice.grid.footer.onClick('refresh'); } catch(e) {} + } + }, + items : [ + ] - } + + }, + '|xns' : 'Roo', + fitToframe : true, + background : true, + region : 'center', + title : "Companies", + xtype : 'GridPanel', + fitContainer : true, + xns : Roo, + tableName : 'Companies', + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, + items : [ + + ] + } - ], - center : { - xtype: 'LayoutRegion', - xns: Roo - }, - south : { - xtype: 'LayoutRegion', - xns: Roo, - height : 150, - split : true, - titlebar : true - } - } - }; - } + ] + + }, + '|xns' : 'Roo', + region : 'center', + xtype : 'NestedLayoutPanel', + title : "Companies", + xns : Roo, + items : [ + + ] + + }; } }); -- 2.39.2