Bonjour,
je n'arrive pas à mettre une barre de scrolling pour un treePanel. J'ai essayé
layout:'vbox', layoutConfig:{align:'stretch'} pour le paneau ouest qui est le parent de mon arbre et flex : 1 pour le treePanel, mais quand je fais une requête pour remplir mon arbre, il ne se remplit pas.

Le code est le suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
new Ext.Panel({
                region: 'west',
                id: 'west-panel',
                title: '<spring:message code="application.zone.navigation"/>',
                split: true,
                width: 250,
                minSize: 175,
                maxSize: 400,
                collapsible: true,
                margins: '0 0 0 5',
                layout: 'vbox',
                layoutConfig:{align:'stretch'},
                items: [
                    new Ext.Panel({
                        layout: 'form',
                        padding: 3,
                        flex:0,
                        items:[
                            {
                                xtype: 'fieldset',
                                title: '<spring:message code="dataEntryMgmt.studyAndCenter"/>',
                                items:[
                                    new Ext.form.ComboBox({
                                        id: 'protocolSearch',
                                        name: 'protocolSearch',
                                        hideLabel: true,
                                        store: protocolSearchDataStore,
                                        displayField:'alias',
                                        typeAhead: false,
                                        loadingText: '<spring:message code="dataEntryMgmt.protocolSearchLoadText"/>',
                                        width: 215,
                                        minChars: 3,
                                        hideTrigger:true,
                                        tpl: protocolSearchResultTemplate,
                                        itemSelector: 'div.search-item',
                                        emptyText:'<spring:message code="dataEntryMgmt.protocolEmptyText"/>',

                                        onSelect: function(record){
                                            this.setValue(record.data.alias);
                                            Ext.getCmp("centerSearch").store.baseParams = { protocolId: record.data.id };
                                            this.collapse();
                                            Ext.getCmp("centerSearch").reset();
                                            Ext.getCmp("subjectFilter").reset();
                                            Ext.getCmp("subjectTreeView").root.removeAll(false);
                                        },
                                        listeners: {
                                               focus: function(scope) {
                                                      scope.reset();
                                                      Ext.getCmp("subjectTreeView").root.removeAll(false);

                                                }
                                        }
                                    }),
                                    new Ext.form.ComboBox({
                                        id: 'centerSearch',
                                        name: 'centerSearch',
                                        hideLabel: true,
                                        store: centerSearchDataStore,
                                        displayField:'centerName',
                                        typeAhead: false,
                                        loadingText: '<spring:message code="dataEntryMgmt.centerSearchLoadText"/>',
                                        width: 215,
                                        minChars: 3,
                                        hideTrigger:true,
                                        tpl: centerSearchResultTemplate,
                                        itemSelector: 'div.search-item',
                                        emptyText:'<spring:message code="dataEntryMgmt.centerEmptyText"/>',
                                        enableKeyEvents: true,
                                        onSelect: function(record) {
                                            this.setValue(record.data.centerName);
                                            Ext.getCmp("subjectTreeView").loader.baseParams = { centerId: record.data.id};
                                            Ext.getCmp("subjectTreeView").root.reload();
                                            Ext.getCmp("subjectTreeView").root.collapse(true);
                                            Ext.getCmp("subjectTreeView").root.expand(true);
                                            this.collapse();
                                            Ext.getCmp("subjectFilter").reset();
                                            Ext.getCmp("subjectTreeView").root.removeAll(false);
                                        },
                                        listeners: {
                                               keyup: function(scope, evt) {
                                                      if(scope.getRawValue()=='') {
                                                            Ext.getCmp("subjectTreeView").root.removeAll(false);
                                                      }
                                                }
                                        }
                                    })]


                            }
                        ]
                    }),
                    {
                        title: '<spring:message code="application.tab.subjects"/>',
                        border: false,
                        items: [new Ext.tree.TreePanel({
                            id: 'subjectTreeView',
                            name: 'subjectTreeView',
                            useArrows: true,
                            autoScroll: true,
                            containerScroll: true,
                            animate: true,
                            enableDD: true,
                            ddScroll: true,
                            border: false,
                            flex: 1,
                            loader: new Ext.tree.TreeLoader({
                                  dataUrl: './getSubjectsTreeNodes.htm'
                            }),
                            root: {
                                nodeType: 'async',
                                text: '<spring:message code="application.tree.Subjects"/>',
                                draggable: false,
                                id: 'subjectRoot',
                                expand: true,
                                subEntityName: 'subject',
                                iconCls: 'subjectsNode',
                                create: true,
                                allowedActions: {
                                    "create": true
                                }
                            },
                            tbar:[ ' ',
                                new Ext.form.TextField({
                                    id: 'subjectFilter',
                                    name: 'subjectFilter',
                                    width: 140,
                                    emptyText:'<spring:message code="dataEntryMgmt.subjectEmptyText"/>',
                                    enableKeyEvents: true,
                                    listeners:{
                                        keydown: {
                                            fn: function(t, e){
                                                filterTree(t);
                                            },
                                            buffer: 350
                                        }
                                    }
                                }), ' ', ' ',
                                {
                                    iconCls: 'icon-expand-all',
                                    tooltip: 'Expand All',
                                    handler: function() {
                                        this.root.expand(true);
                                    },
                                    scope: this
                                }, '-', {
                                    iconCls: 'icon-collapse-all',
                                    tooltip: 'Collapse All',
                                    handler: function() {
                                        this.root.collapse(true);
                                    },
                                    scope: this
                                }]

                        })],
                        listeners: {
                            expand: function(panel) {
                                selectedDataEntryTree = Ext.getCmp('subjectTreeView');
                                selectedDataEntryNode = Ext.getCmp('subjectTreeView').getSelectionModel().getSelectedNode();
                                updateActionsAvailability(dataEntryActions, selectedDataEntryNode != null ? selectedDataEntryNode.attributes['allowedActions'] : [], 'DataEntry');
                            }

                        }
                    }
                ]
            }),
Merci pour vos réponses