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');
40 if (!_this.grid.getSelectionModel().getSelected()) {
42 _this.viewPanel.setContent("Please select a version on the left");
53 title : "Saved Version",
60 activate : function() {
63 _this.grid.footer.onClick('first');
81 if (_this.panel.active) {
82 this.footer.onClick('first');
86 autoExpandColumn : 'event_when',
89 xtype: 'RowSelectionModel',
92 afterselectionchange : function (_self)
94 var selected = this.getSelected();
96 _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);
146 sortInfo : { field : 'event_when', direction: 'DESC' },
151 url : baseURL + '/Roo/Events.php'
158 totalProperty : 'total',
165 'name': 'event_when',
172 xtype: 'PagingToolbar',
179 xtype: 'ColumnModel',
181 dataIndex : 'event_when',
184 renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }
190 xtype: 'ContentPanel',
193 render : function (_self)
195 _this.viewPanel = _self;
206 xtype: 'LayoutRegion',
210 xtype: 'LayoutRegion',
234 if (_this.callback && _this.source != '') {
235 _this.callback.call(this, _this.source);