-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExtjsMainView-js.vm
58 lines (55 loc) · 1.6 KB
/
ExtjsMainView-js.vm
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
Ext.define('${PROJECT_NAME}.view.main.MainView', {
extend: 'Ext.container.Viewport',
xtype: 'app-main-view',
layout: 'border',
id: 'mainLayout',
bodyBorder: false,
defaults: {
split: true,
bodyPadding: 10,
id: 'contentwindow',
margin: '5 0 0 0'
},
items: [{
title: '${PROJECT_NAME}',
region: 'west',
id: 'menuwindow',
floatable: false,
collapsible: true,
width: 210,
minWidth: 100,
maxWidth: 250,
collapsible: false,
items: [{
html: '<h2>xtype to render</h2>'
}, {
xtype: 'textfield'
}, {
xtype: 'button',
text: 'try it!',
handler: function (thisObj) {
let mainlayout = Ext.getCmp('mainLayout');
mainlayout.remove(Ext.getCmp('contentwindow'));
mainlayout.add({
xtype: thisObj.prev().getValue(),
region: 'center'
});
}
}]
}, {
title: 'Main Content',
collapsible: false,
region: 'center',
items: [{
html: '<h2>Main Page</h2><p>This is where the main content would go</p>'
}]
}]
});
Ext.Object.each(Ext.ClassManager.aliasToName, function (alias, className) {
if (className.startsWith('${PROJECT_NAME}.view')) {
let aliasParts = alias.split('.');
if (aliasParts[0] === 'widget' && aliasParts[1].endsWith('-grid')) {
console.log('xtype = [' + aliasParts[1] + ']', 'class = ' + className);
}
}
});