X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Dialog.CoreAutoSavePreview.js;h=96d2178c630d23dcb1b30e2d8b5f55155d0d5799;hp=ff23487910a5fcd4d89704684cf82057440a4ad1;hb=586e4eb470252d837ba18b67e4c3c1702131fd1d;hpb=4ce157bb60e971d206acea30d2d0c5144ac2de17 diff --git a/Pman.Dialog.CoreAutoSavePreview.js b/Pman.Dialog.CoreAutoSavePreview.js index ff234879..96d2178c 100644 --- a/Pman.Dialog.CoreAutoSavePreview.js +++ b/Pman.Dialog.CoreAutoSavePreview.js @@ -39,58 +39,15 @@ 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', + xtype : 'LayoutDialog', 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, - 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,14 +57,152 @@ Pman.Dialog.CoreAutoSavePreview = { } }, - items : [ + xns : Roo, + '|xns' : 'Roo', + center : { + xtype : 'LayoutRegion', + xns : Roo, + '|xns' : 'Roo' + }, + west : { + xtype : 'LayoutRegion', + split : true, + width : 200, + xns : Roo, + '|xns' : 'Roo' + }, + buttons : [ + { + xtype : 'Button', + text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */, + listeners : { + click : function() { + _this.dialog.hide(); + } + }, + xns : Roo, + '|xns' : 'Roo' + }, + { + xtype : 'Button', + text : _this._strings['e0aa021e21dddbd6d8cecec71e9cf564'] /* OK */, + listeners : { + click : function() { + + _this.dialog.hide(); + + if (_this.callback && _this.source != '') { + _this.callback.call(this, _this.source); + } + } + }, + xns : Roo, + '|xns' : 'Roo' + } + ], + items : [ { + xtype : 'GridPanel', + background : false, + fitContainer : true, + fitToframe : true, + region : 'west', + tableName : 'Events', + title : _this._strings['87f9f735a1d36793ceaecd4e47124b63'] /* Events */, + listeners : { + activate : function() { + _this.panel = this; + if (_this.grid) { + _this.grid.footer.onClick('first'); + } + } + }, + xns : Roo, + '|xns' : 'Roo', grid : { + xtype : 'Grid', + autoExpandColumn : 'event_when', + loadMask : true, + listeners : { + render : function() + { + _this.grid = this; + + if (_this.panel.active) { + this.footer.onClick('first'); + } + } + }, + xns : Roo.grid, + '|xns' : 'Roo.grid', + footer : { + xtype : 'PagingToolbar', + displayInfo : false, + pageSize : 25, + xns : Roo, + '|xns' : 'Roo' + }, + dataSource : { + xtype : 'Store', + remoteSort : true, + sortInfo : { field : 'event_when', direction: 'DESC' }, + 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); + } + } + }, + xns : Roo.data, + '|xns' : 'Roo.data', + proxy : { + xtype : 'HttpProxy', + method : 'GET', + url : baseURL + '/Roo/Events.php', + xns : Roo.data, + '|xns' : 'Roo.data' + }, + reader : { + xtype : 'JsonReader', + fields : [ + { + 'name': 'id', + 'type': 'int' + }, + { + 'name': 'event_when', + 'type': 'string' + } + ], + id : 'id', + root : 'data', + totalProperty : 'total', + xns : Roo.data, + '|xns' : 'Roo.data' + } + }, sm : { - '|xns' : 'Roo.grid', - singleSelect : true, - xns : Roo.grid, xtype : 'RowSelectionModel', + singleSelect : true, listeners : { afterselectionchange : function (_self) { @@ -144,157 +239,49 @@ 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, + '|xns' : 'Roo.grid' }, - '|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'); - } + { + xtype : 'ColumnModel', + 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' } - }, - items : [ - - ] - + ] + } }, { - '|xns' : 'Roo', + xtype : 'ContentPanel', autoScroll : true, background : false, fitContainer : true, fitToFrame : true, region : 'center', - xns : Roo, - xtype : 'ContentPanel', listeners : { render : function (_self) { _this.viewPanel = _self; } - } + }, + xns : Roo, + '|xns' : 'Roo' } ] - }); } };