-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathborder.js
95 lines (82 loc) · 1.8 KB
/
border.js
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
75
76
77
78
79
80
81
82
83
84
85
86
/**
*
*/
Ext.require(['*']);
Ext.onReady(function(){
var cw;
var viewport = null;
function closeRegion(e, target, header, toll){
var region = header.ownerCt;
newRegions.unshift(region.initialConfig);
viewport.remove(region);
}
viewport = Ext.create('Ext.Viewport', {
layout: {
type: 'border',
padding: 5
},
defaults: {
split: true,
},
items: [{
region: 'north',
collapsible: true,
title: 'North',
split: true,
minHeight: 60,
html: 'north'
},{
region: 'west',
collapsible: true,
title: 'Starts at with 30%',
split: true,
width: '30%',
minWidth: 100,
minHeight: 140,
html: 'west<br>I am floatabel'
},{
region: 'center',
html: 'center center',
title: 'Center',
minHeight: 80,
items: [cw = Ext.create('Ext.Window',{
xtype: 'window',
closable: false,
minimizable: true,
title: 'Constrained Window',
height: 200,
width: 400,
constrain: true,
html: 'I am in a container',
itemId: 'center-window',
minimize: function(){
this.floatParent.down('button#toggleCw').toggle();
}
})],
bbar: ['Text followed by a spacer', ' ', {
itemsId: 'toggleCw',
text: 'Constrained Window',
enableToggle: true,
toggleHandler: function(){
cw.setVisible(!cw.isVisible());
}
},{
text: 'Ajax Request',
listeners: {
click: function(){
Ext.Ajax.request({
url : 'ajax_server.jsp',
params : {roleid:'me'},
success : function(xhr){
Ext.Msg.alert('alert', 'Success!');
},
failure:function(xhr){
Ext.Msg.alert("alert", "failure!");
}
});
}
}
}]
}]
});
});