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();
91 _this.viewPanel.load( { url : baseURL + "/Roo/Events", method : 'GET' }, {_id : selected.data.id, _retrieve_source : 1}, function(oElement, bSuccess, oResponse){
95 var res = Roo.decode(oResponse.responseText);
97 if(!bSuccess || !res.success){
98 _this.viewPanel.setContent("Load data failed?!");
101 if(typeof(res.data) === 'string'){
102 _this.viewPanel.setContent(res.data);
106 if(!_this.data.successFn){
107 Roo.MessageBox.alert('Error', 'Please setup the successFn');
111 _this.source = _this.data.successFn(res);
113 _this.viewPanel.setContent(_this.source);
124 beforeload : function (_self, o)
126 o.params = o.params || {};
128 if(typeof(_this.data) == 'undefined'){
133 var d = Roo.apply({}, _this.data);
136 Roo.apply(o.params, d);
139 load : function (_self, records, options)
141 var sm = _this.grid.getSelectionModel();
142 if (!sm.getSelections().length) {
149 sortInfo : { field : 'event_when', direction: 'DESC' },
154 url : baseURL + '/Roo/Events.php'
161 totalProperty : 'total',
168 'name': 'event_when',
175 xtype: 'PagingToolbar',
182 xtype: 'ColumnModel',
184 dataIndex : 'event_when',
187 renderer : function(v) { return String.format('{0}', v ? v.format('Y-m-d H:i:s') : ''); }
193 xtype: 'ContentPanel',
196 render : function (_self)
198 _this.viewPanel = _self;
209 xtype: 'LayoutRegion',
213 xtype: 'LayoutRegion',
237 if (_this.callback && _this.source != '') {
238 _this.callback.call(this, _this.source);