-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCanDataBaseController.js
More file actions
74 lines (63 loc) · 2.03 KB
/
CanDataBaseController.js
File metadata and controls
74 lines (63 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Ext.define('app.controller.canDataBase.CanDataBaseController', {
extend: 'Ext.app.ViewController',
alias:'controller.canDataBaseController',
onAdd:function(btn){
var url = '../canDataBase.do?method=initData';
Ext.Ajax.request({url: url,method: 'post',
success: function(resp,opts) {
}
});
},
openModule:function(title,params,btn){
},
showJsonTree:function(btn){
var url = '../canDataBase.do?method=showJsonTree';
Ext.Ajax.request({url: url,method: 'post',
success: function(resp,opts) {
Ext.Msg.alert("success!");
}
});
},
onImport:function(btn){
var me = this;
var title = "import...";
me.openImportWin(title,null,btn);
},
// onExport:function(btn){
// var me = this;
// var title = "导出操作";
// me.openExportWin(title,null,btn);
// },
openImportWin:function(title,params,btn){
PU.openModule({title:title,xtype:"importWin",width:400,params:params,animateTarget:btn,scope:this,callback:function(result){
}});
},
// openExportWin:function(title,params,btn){
// PU.openModule({title:title,xtype:"exportWin",width:400,params:params,animateTarget:btn,scope:this,callback:function(result){
// }});
// },
saveAsJson:function(btn){
var url = '../canDataBase.do?method=saveAsJsonFile';
Ext.Ajax.request({url: url,method: 'post',
success: function(resp,opts) {
Ext.Msg.alert("success!");
}
});
},
onAfterRender:function(paging){
var gridstore = Ext.create('Ext.data.Store', {
pageSize: 20,
autoLoad: {start: 0, limit: 20},
proxy: {
type: 'ajax',
url: '../canDataBase.do?method=pageList',
reader: {type: 'json',rootProperty: 'data',totalProperty:'totalProperty'}
}
});
this.gridpanel.setStore(gridstore);
paging.setStore(gridstore);
},
init:function(){
this.gridpanel = this.lookupReference('gridPanel');
}
});