From: edward Date: Wed, 30 Mar 2016 06:03:00 +0000 (+0800) Subject: Pman.Dialog.CoreAutoSavePreview.bjs X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=7c55fa1f6cb1ff9e142224fbfe735e8763a12a55 Pman.Dialog.CoreAutoSavePreview.bjs Pman.Dialog.CoreAutoSavePreview.js --- diff --git a/Pman.Dialog.CoreAutoSavePreview.bjs b/Pman.Dialog.CoreAutoSavePreview.bjs index 8bf1f067..36803d06 100644 --- a/Pman.Dialog.CoreAutoSavePreview.bjs +++ b/Pman.Dialog.CoreAutoSavePreview.bjs @@ -2,7 +2,7 @@ "name" : "Pman.Dialog.CoreAutoSavePreview", "parent" : "", "title" : "", - "path" : "/home/alan/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs", + "path" : "/home/edward/gitlive/Pman.Core/Pman.Dialog.CoreAutoSavePreview.bjs", "permname" : "", "modOrder" : "001", "strings" : { @@ -36,8 +36,8 @@ }, { "xtype" : "LayoutRegion", - "width" : 200, "$ xns" : "Roo", + "width" : 200, "split" : true, "* prop" : "west" }, @@ -45,9 +45,9 @@ "listeners" : { "|activate" : "function() {\n _this.panel = this;\n if (_this.grid) {\n _this.grid.footer.onClick('first');\n }\n}" }, + "region" : "west", "fitToframe" : true, "background" : false, - "region" : "west", "title" : "Events", "xtype" : "GridPanel", "fitContainer" : true, @@ -86,8 +86,8 @@ "items" : [ { "$ url" : "baseURL + '/Roo/Events.php'", - "xtype" : "HttpProxy", "method" : "GET", + "xtype" : "HttpProxy", "$ xns" : "Roo.data", "* prop" : "proxy" }, @@ -111,8 +111,8 @@ }, { "xtype" : "ColumnModel", - "width" : 100, "header" : "Date", + "width" : 100, "$ renderer" : "function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -120,8 +120,8 @@ }, { "xtype" : "ColumnModel", - "header" : "By", "width" : 100, + "header" : "By", "$ renderer" : "function(v) { return String.format('{0}', v ); }", "$ xns" : "Roo.grid", "* prop" : "colModel[]", @@ -136,8 +136,8 @@ "render" : "function (_self)\n{\n _this.viewPanel = _self;\n}" }, "autoScroll" : true, - "background" : false, "fitToFrame" : true, + "background" : false, "region" : "center", "xtype" : "ContentPanel", "fitContainer" : true, diff --git a/Pman.Dialog.CoreAutoSavePreview.js b/Pman.Dialog.CoreAutoSavePreview.js index ff234879..e679c3aa 100644 --- a/Pman.Dialog.CoreAutoSavePreview.js +++ b/Pman.Dialog.CoreAutoSavePreview.js @@ -39,58 +39,17 @@ Pman.Dialog.CoreAutoSavePreview = { { var _this = this; this.dialog = Roo.factory({ - center : { - '|xns' : 'Roo', - xns : Roo, - xtype : 'LayoutRegion' - }, - west : { - '|xns' : 'Roo', - split : true, - width : 200, - xns : Roo, - xtype : 'LayoutRegion' - }, - '|xns' : 'Roo', background : false, closable : false, collapsible : false, height : 500, modal : true, resizable : false, - title : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'], + title : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */, width : 800, xns : Roo, + '|xns' : 'Roo', xtype : 'LayoutDialog', - buttons : [ - { - '|xns' : 'Roo', - text : _this._strings['ea4788705e6873b424c65e91c2846b19'], - xns : Roo, - xtype : 'Button', - listeners : { - click : function() { - _this.dialog.hide(); - } - } - }, -{ - '|xns' : 'Roo', - text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'], - xns : Roo, - xtype : 'Button', - listeners : { - click : function() { - - _this.dialog.hide(); - - if (_this.callback && _this.source != '') { - _this.callback.call(this, _this.source); - } - } - } - } - ], listeners : { show : function (_self) { @@ -100,13 +59,151 @@ Pman.Dialog.CoreAutoSavePreview = { } }, - items : [ + center : { + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + west : { + split : true, + width : 200, + xns : Roo, + '|xns' : 'Roo', + xtype : 'LayoutRegion' + }, + buttons : [ { + text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'Button', + listeners : { + click : function() { + _this.dialog.hide(); + } + } + }, + { + text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'Button', + listeners : { + click : function() { + + _this.dialog.hide(); + + if (_this.callback && _this.source != '') { + _this.callback.call(this, _this.source); + } + } + } + } + ], + items : [ + { + background : false, + fitContainer : true, + fitToframe : true, + region : 'west', + tableName : 'Events', + title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */, + xns : Roo, + '|xns' : 'Roo', + xtype : 'GridPanel', + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, grid : { + autoExpandColumn : 'event_when', + loadMask : true, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'Grid', + listeners : { + render : function() + { + _this.grid = this; + + if (_this.panel.active) { + this.footer.onClick('first'); + } + } + }, + footer : { + displayInfo : false, + pageSize : 25, + xns : Roo, + '|xns' : 'Roo', + xtype : 'PagingToolbar' + }, + dataSource : { + remoteSort : true, + sortInfo : { field : 'event_when', direction: 'DESC' }, + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'Store', + listeners : { + beforeload : function (_self, o) + { + o.params = o.params || {}; + + if(typeof(_this.data) == 'undefined'){ + this.removeAll(); + return false; + } + + var d = Roo.apply({}, _this.data); + delete d.successFn; + + Roo.apply(o.params, d); + + }, + load : function (_self, records, options) + { + var sm = _this.grid.getSelectionModel(); + if (!sm.getSelections().length) { + sm.selectFirstRow(); + + sm.fireEvent('afterselectionchange', sm); + } + } + }, + proxy : { + method : 'GET', + url : baseURL + '/Roo/Events.php', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'HttpProxy' + }, + reader : { + fields : [ + { + 'name': 'id', + 'type': 'int' + }, + { + 'name': 'event_when', + 'type': 'string' + } + ], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data', + xtype : 'JsonReader' + } + }, sm : { - '|xns' : 'Roo.grid', singleSelect : true, xns : Roo.grid, + '|xns' : 'Roo.grid', xtype : 'RowSelectionModel', listeners : { afterselectionchange : function (_self) @@ -146,145 +243,36 @@ Pman.Dialog.CoreAutoSavePreview = { } } }, - dataSource : { - proxy : { - '|xns' : 'Roo.data', - method : 'GET', - url : baseURL + '/Roo/Events.php', - xns : Roo.data, - xtype : 'HttpProxy' - }, - reader : { - '|xns' : 'Roo.data', - fields : [ - { - 'name': 'id', - 'type': 'int' - }, - { - 'name': 'event_when', - 'type': 'string' - } - ], - id : 'id', - root : 'data', - totalProperty : 'total', - xns : Roo.data, - xtype : 'JsonReader' - }, - '|xns' : 'Roo.data', - remoteSort : true, - sortInfo : { field : 'event_when', direction: 'DESC' }, - xns : Roo.data, - xtype : 'Store', - listeners : { - beforeload : function (_self, o) - { - o.params = o.params || {}; - - if(typeof(_this.data) == 'undefined'){ - this.removeAll(); - return false; - } - - var d = Roo.apply({}, _this.data); - delete d.successFn; - - Roo.apply(o.params, d); - - }, - load : function (_self, records, options) - { - var sm = _this.grid.getSelectionModel(); - if (!sm.getSelections().length) { - sm.selectFirstRow(); - - sm.fireEvent('afterselectionchange', sm); - } - } - }, - items : [ - - ] - - }, - footer : { - '|xns' : 'Roo', - displayInfo : false, - pageSize : 25, - xns : Roo, - xtype : 'PagingToolbar' - }, - '|xns' : 'Roo.grid', - autoExpandColumn : 'event_when', - loadMask : true, - xns : Roo.grid, - xtype : 'Grid', colModel : [ - { - '|xns' : 'Roo.grid', - dataIndex : 'event_when', - header : _this._strings['44749712dbec183e983dcd78a7736c41'], - renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }, - width : 100, - xns : Roo.grid, - xtype : 'ColumnModel' - }, -{ - '|xns' : 'Roo.grid', - dataIndex : 'person_id_name', - header : _this._strings['53e5aa2c97fef1555d2511de8218c544'], - renderer : function(v) { return String.format('{0}', v ); }, - width : 100, - xns : Roo.grid, - xtype : 'ColumnModel' - } - ], - listeners : { - render : function() - { - _this.grid = this; - - if (_this.panel.active) { - this.footer.onClick('first'); - } - } - }, - items : [ - - ] - - }, - '|xns' : 'Roo', - background : false, - fitContainer : true, - fitToframe : true, - region : 'west', - tableName : 'Events', - title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'], - xns : Roo, - xtype : 'GridPanel', - listeners : { - activate : function() { - _this.panel = this; - if (_this.grid) { - _this.grid.footer.onClick('first'); - } + { + dataIndex : 'event_when', + header : _this._strings['44749712dbec183e983dcd78a7736c41'] /* Date */, + renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' + }, + { + dataIndex : 'person_id_name', + header : _this._strings['53e5aa2c97fef1555d2511de8218c544'] /* By */, + renderer : function(v) { return String.format('{0}', v ); }, + width : 100, + xns : Roo.grid, + '|xns' : 'Roo.grid', + xtype : 'ColumnModel' } - }, - items : [ - - ] - + ] + } }, { - '|xns' : 'Roo', autoScroll : true, background : false, fitContainer : true, fitToFrame : true, region : 'center', xns : Roo, + '|xns' : 'Roo', xtype : 'ContentPanel', listeners : { render : function (_self) @@ -294,7 +282,6 @@ Pman.Dialog.CoreAutoSavePreview = { } } ] - }); } };