我有以下代码在树商店内创建一个可扩展的树面板。我的问题是autoscroll
true 和 scroll true 我已经有了一个滚动条。
当我在树中展开一个文件夹时,会创建一个 gridscroll 并将其附加到主容器中,并并排创建两个滚动条。
如何捕获扩展文件夹并防止呈现网格滚动条?
我认为这是setAutoScroll(false)
列上的方法,但我不知道如何设置它。
Ext.Loader.setConfig({
enabled: true,
disableCaching: false
});
Ext.require(['Ext.form.*', 'Ext.tree.*', 'Ext.grid.*', 'Ext.data.*', 'Ext.util.*', 'Ext.tip.QuickTipManager', 'Ext.ux.grid.FiltersFeature', 'Ext.ModelManager']);
Ext.onReady(function() {
Ext.define('model1', {
extend: 'Ext.data.Model',
fields: [{
name: 'text',
type: 'string'
}, {
name: 'pathInfo',
type: 'string'
}]
});
storeAddTo = Ext.create('Ext.data.TreeStore', {
model: 'model1',
folderSort: true,
root: {
expanded: true,
children: myJSONTextAddTo
}
});
var treeConfigAddTo = {
//title: 'Select an existing folder from the list',
id: 'grid-foldersAddTo',
width: 320,
height: 330,
store: storeAddTo, //
rootVisible: false,
useArrows: true,
singleExpand: false,
renderTo: 'grid-foldersAddTo',
columns: [{
xtype: 'treecolumn',
text: 'Folders',
flex: 1,
sortable: false,
dataIndex: 'text',
filterable: false
}],
viewConfig: {
autoScroll: true,
scroll: true,
}
}
treeAddTo = Ext.create('Ext.tree.Panel', treeConfigAddTo);
});
数据(myJSONTextAddTo)
[{
text: "Cars",
"pathInfo": "Cars",
children: [{
text: "Luxury",
"pathInfo": "Cars\\Luxury\\Bentley",
children: [{
text: "Bentley",
"pathInfo": "Cars\\Luxury\\Bentley",
children: []
}, {
text: "Porsche",
"pathInfo": "Cars\\Luxury\\Porsche",
children: [{
text: "Cars",
"pathInfo": "Cars\\Luxury\\Porsche\\Cars\\Luxury\\Porsche",
children: [{
text: "Luxury",
"pathInfo": "Cars\\Luxury\\Porsche\\Cars\\Luxury\\Porsche",
children: [{
text: "Porsche",
"pathInfo": "Cars\\Luxury\\Porsche\\Cars\\Luxury\\Porsche",
children: []
}]
}]
}]
}]
}, {
text: "Dealers",
"pathInfo": "Cars\\Dealers",
children: []
}, {
text: "Ferrari",
"pathInfo": "Cars\\Ferrari",
children: []
}, {
text: "Sports",
"pathInfo": "Cars\\Sports",
children: [{
text: "Chevy",
"pathInfo": "Cars\\Sports\\Chevy",
children: []
}]
}, {
text: "mycar",
"pathInfo": "Cars\\mycar",
children: []
}, {
text: "test2",
"pathInfo": "Cars\\test2",
children: []
}, {
text: "test3",
"pathInfo": "Cars\\test3",
children: []
}, {
text: "test4",
"pathInfo": "Cars\\test4",
children: []
}, {
text: "test5",
"pathInfo": "Cars\\test5",
children: []
}, {
text: "test 6",
"pathInfo": "Cars\\test 6",
children: [{
text: "Test 6.1",
"pathInfo": "Cars\\test 6\\Test 6.1",
children: []
}]
}]
}]