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");
97 _this.viewPanel.load( { url : baseURL + "/Roo/Events", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){
99 var res = Roo.decode(oResponse.responseText);
101 if(!bSuccess || !res.success){
102 _this.viewPanel.setContent("Load data failed?!");
105 if(typeof(res.data) === 'string'){
106 _this.viewPanel.setContent(res.data);
110 if(!_this.data.successFn){
111 Roo.MessageBox.alert('Error', 'Please setup the successFn');
115 _this.source = _this.data.successFn(res);
117 _this.viewPanel.setContent(_this.source);
128 beforeload : function (_self, o)
130 o.params = o.params || {};
132 if(typeof(_this.data) == 'undefined'){
137 var d = Roo.apply({}, _this.data);
140 Roo.apply(o.params, d);
143 load : function (_self, records, options)
145 var sm = _this.grid.getSelectionModel();
146 if (!sm.getSelections().length) {
149 sm.fireEvent('afterselectionchange', sm);
154 sortInfo : { field : 'event_when', direction: 'DESC' },
159 url : baseURL + '/Roo/Events.php'
166 totalProperty : 'total',
173 'name': 'event_when',
180 xtype: 'PagingToolbar',
187 xtype: 'ColumnModel',
189 dataIndex : 'event_when',
192 renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }
198 xtype: 'ContentPanel',
201 render : function (_self)
203 _this.viewPanel = _self;
214 xtype: 'LayoutRegion',
218 xtype: 'LayoutRegion',
242 if (_this.callback && _this.source != '') {
243 _this.callback.call(this, _this.source);