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');
39 Roo.log('call show?');
40 Roo.log(_this.grid.getSelectionModel().getSelected());
41 if (!_this.grid.getSelectionModel().getSelected()) {
43 _this.viewPanel.setContent("Please select a version on the left");
54 title : "Saved Version",
61 activate : function() {
64 _this.grid.footer.onClick('first');
82 if (_this.panel.active) {
83 this.footer.onClick('first');
87 autoExpandColumn : 'event_when',
90 xtype: 'RowSelectionModel',
93 afterselectionchange : function (_self)
95 var selected = this.getSelected();
97 _this.viewPanel.load( { url : baseURL + "/Roo/Events", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){
101 var res = Roo.decode(oResponse.responseText);
103 if(!bSuccess || !res.success){
104 _this.viewPanel.setContent("Load data failed?!");
107 if(typeof(res.data) === 'string'){
108 _this.viewPanel.setContent(res.data);
112 if(!_this.data.successFn){
113 Roo.MessageBox.alert('Error', 'Please setup the successFn');
117 _this.source = _this.data.successFn(res);
119 _this.viewPanel.setContent(_this.source);
130 beforeload : function (_self, o)
132 o.params = o.params || {};
134 if(typeof(_this.data) == 'undefined'){
139 var d = Roo.apply({}, _this.data);
142 Roo.apply(o.params, d);
147 sortInfo : { field : 'event_when', direction: 'DESC' },
152 url : baseURL + '/Roo/Events.php'
159 totalProperty : 'total',
166 'name': 'event_when',
173 xtype: 'PagingToolbar',
180 xtype: 'ColumnModel',
182 dataIndex : 'event_when',
185 renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }
191 xtype: 'ContentPanel',
194 render : function (_self)
196 _this.viewPanel = _self;
207 xtype: 'LayoutRegion',
211 xtype: 'LayoutRegion',
235 if (_this.callback && _this.source != '') {
236 _this.callback.call(this, _this.source);