-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathlayout-card.html
66 lines (62 loc) · 2.34 KB
/
layout-card.html
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
<!DOCTYPE html>
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
requires: [
'Ext.layout.container.Card'],
layout: 'card', // 在这个布局中,每次元素来到完整的容器空间。 向导中将有一个底部工具栏用于导航。
width: 600,
height: 200,
bodyPadding: 15,
defaults: {
border:false
},
defaultListenerScope: true,
bbar: ['->',
{
itemId: 'card-prev',
text: '« Previous',
handler: 'showPrevious',
disabled: true
},{
itemId: 'card-next',
text: 'Next »',
handler: 'showNext'
}],
items: [{
id: 'card0',
html: '<h2> This is card wizard layout </h2> <p> This is first card </p> <p> Please click the "Next" button to continue... </p>'
},{
id: 'card1',
html: '<p> This is second card </p> <p> Please click the "Next" button for next card and "Previous" button for previous card... </p>'
},{
id: 'card2',
html: '<p> This is final card </p> <p> Please click the "Previous" button for previous card... </p>'
}],
showNext: function () {
this.cardPanelNavigation(1);
},
showPrevious: function (btn) {
this.cardPanelNavigation(-1);
},
cardPanelNavigation: function (incr) {
var me = this;
var l = me.getLayout();
var i = l.activeItem.id.split('card')[1];
var next = parseInt(i, 10) + incr;
l.setActiveItem(next);
me.down('#card-prev').setDisabled(next===0);
me.down('#card-next').setDisabled(next===2);
}
});
});
</script>
</head>
<body>
</body>
</html>