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
|
<! DOCTYPE html>
< html >
< head >
< title >ExtJs</ title >
< meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
< link rel="stylesheet" type="text/css" href="ExtJs/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">
< script type="text/javascript" src="ExtJs/ext-all.js"></ script >
< script type="text/javascript" src="ExtJs/bootstrap.js"></ script >
< script type="text/javascript" src="ExtJs/packages/ext-theme-crisp/build/ext-theme-crisp.js"></ script >
< script type="text/javascript">
Ext.onReady(function(){
var panel = Ext.create('Ext.panel.Panel', {
title: 'Ext.layout.container.CardLayout',
frame: true,
width: 250,
renderTo: Ext.getBody(),
bodyPadding: 5,
defaults: {
bodyStyle: 'background-color: #FFFFFF'
},
//layout: 'auto',
//layout: 'fit',
//layout: 'accordion',
layout: 'card',
activeItem: 0,
items: [{
title: 'Panel One',
html: 'Panel One',
id: 'p1'
},{
title: 'Panel Two',
html: 'Panel Two',
id: 'p2'
},{
title: 'Panel Three',
html: 'Panel Three',
id: 'p3'
}],
buttons: [{
text: 'previous',
handler: changePage
},{
text: 'next',
handler: changePage
}]
});
function changePage(btn){
var index = Number(panel.layout.activeItem.id.substring(1));
if(btn.text == 'previous'){
index -= 1;
if(index < 1 ){
index = 1;
}
}else{
index += 1;
if(index > 3){
index = 3;
}
}
panel.layout.setActiveItem('p'+index);
}
});
</ script >
</ head >
< body >
</ body >
</ html >
|