help.js
2.44 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
Ext.onReady(function () {
var contentPanel = {
id: 'content-panel',
region: 'center', // this is what makes this panel into a region within the containing layout
border: true,
autoScroll: true,
bodyCls : 'infoWindow',
bodyStyle: 'padding:15px 15px 15px 15px;',
loader : {
url : 'help/' + 'ABC',
loadMask : false,
autoLoad : true // important
}
};
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true
},
proxy: {
type: 'ajax',
url: 'help/content.json'
}
});
var treePanel = Ext.create('Ext.tree.Panel', {
id: 'tree-panel',
title: 'Inside the AMDA',
region:'west',
split: true,
width: 250,
minSize: 150,
rootVisible: false,
autoScroll: true,
store: store
});
// Assign loader to be called on tree node click.
treePanel.getSelectionModel().on('select', function(selModel, record) {
if (record.get('leaf')) {
Ext.getCmp('content-panel').loader.url = 'help/' + record.getId();
Ext.getCmp('content-panel').loader.load();
}
});
var win = Ext.create('Ext.window.Window', {
width: 800,
height: 500,
autoScroll : true,
minimizable: true,
hidden: false,
shadow: false,
maximizable: true,
title: 'Help: While Demo Tour Is Not Ready ...',
autoShow: true,
layout: 'border',
items: [
treePanel,
contentPanel
]
});
});