1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Pman.Dialog.CoreAutoSavePreview = {
10 show : function(data, cb)
18 this.dialog.show(this.data._el);
21 this.form.setValues(data);
22 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
30 this.dialog = Roo.factory({
31 xtype: 'LayoutDialog',
34 show : function (_self)
36 if(typeof(_this.data) != 'undefined'){
37 _this.grid.footer.onClick('first');
48 title : "Saved Version",
55 activate : function() {
58 _this.grid.footer.onClick('first');
76 if (_this.panel.active) {
77 this.footer.onClick('first');
81 autoExpandColumn : 'event_when',
84 xtype: 'RowSelectionModel',
87 afterselectionchange : function (_self)
89 var selected = this.getSelected();
94 _this.viewPanel.setContent("Please select an saved version on the left");
98 _this.viewPanel.load( { url : baseURL + "/Roo/Events", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){
100 var res = Roo.decode(oResponse.responseText);
102 if(!bSuccess || !res.success){
103 _this.viewPanel.setContent("Load data failed?!");
106 if(typeof(res.data) === 'string'){
107 _this.viewPanel.setContent(res.data);
111 if(!_this.data.successFn){
112 Roo.MessageBox.alert('Error', 'Please setup the successFn');
116 _this.source = _this.data.successFn(res);
118 _this.viewPanel.setContent(_this.source);
129 beforeload : function (_self, o)
131 o.params = o.params || {};
133 if(typeof(_this.data) == 'undefined'){
138 var d = Roo.apply({}, _this.data);
141 Roo.apply(o.params, d);
144 load : function (_self, records, options)
146 var sm = _this.grid.getSelectionModel();
147 if (!sm.getSelections().length) {
150 sm.fireEvent('afterselectionchange', sm);
155 sortInfo : { field : 'event_when', direction: 'DESC' },
160 url : baseURL + '/Roo/Events.php'
167 totalProperty : 'total',
174 'name': 'event_when',
181 xtype: 'PagingToolbar',
188 xtype: 'ColumnModel',
190 dataIndex : 'event_when',
193 renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }
199 xtype: 'ContentPanel',
202 render : function (_self)
204 _this.viewPanel = _self;
215 xtype: 'LayoutRegion',
219 xtype: 'LayoutRegion',
243 if (_this.callback && _this.source != '') {
244 _this.callback.call(this, _this.source);