나는 ext-js를 처음 사용하며 축소를위한 축소 도구가있는 트리 패널이 있습니다/축소 도구를 클릭 할 때 패널의
을 펼치십시오.
패널의 제목에있는 축소 도구 버튼에 대한 참조를 얻는 방법을 알고 싶었습니다.
클릭 이벤트를 사용하여 축소 도구를 클릭하여 패널이 접히거나 펼쳐지도록하고 싶습니다. 해결책 찾기에 도와주세요.패널 축소 도구에 대한 참조를 얻는 방법
Ext.define('project.view.navigation', {
extend: 'Ext.tree.Panel',
alias: 'widget.navigation',
requires: [
'Ext.tree.View'
],
width: 295,
animCollapse: true,
collapsed: true,
collapsible: true,
title: 'Menu',
titleCollapse: false,
store: 'navigationStore',
rootVisible: false,
initComponent: function() {
var me = this;
Ext.applyIf(me, {
viewConfig: {
}
});
me.callParent(arguments);
}
});
저는 Sencha Architect 3.0을 사용했습니다.
이 트리 패널은 테두리 레이아웃의 뷰포트의 서쪽 영역에 있습니다.
메인 뷰포트 코드
Ext.define('projectName.view.mainView', {
extend: 'Ext.container.Viewport',
requires: [
'projectName.view.header',
'projectName.view.navigation',
'projectName.view.searchContent',
'projectName.view.content',
'projectName.view.footer',
'Ext.tree.Panel'
],
itemId: 'mainView',
layout: 'border',
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'container',
region: 'center',
cls: 'mainContainer',
layout: 'border',
items: [
{
xtype: 'appHeader',
height: 100,
region: 'north'
},
{
xtype: 'navigation',
region: 'west'
},
{
xtype: 'searchContent',
region: 'west'
},
{
xtype: 'content',
region: 'center'
},
{
xtype: 'footer',
region: 'south'
}
]
}
]
});
me.callParent(arguments);
}
}) 아래에 나타낸 바와 같고;
'도구 모음 축소'코드 조각을 붙여주세요. – Sreek521
나는 붕괴 도구를 원하는 Tree Panel에 대한 코드를 넣었다. – sumanth
[이것은 바이올린 링크입니다] (https://fiddle.sencha.com/#fiddle/7in) – sumanth