树形面板 extjs 4 中的滚动条不起作用
我在 extjs 4 中遇到滚动条问题。 水平滚动条不显示,垂直滚动条不移动。我在 google chrome、IE 和 firefox 中测试了代码。 JavaScript 不显示错误。
这是代码的一部分,在productos_panel中是问题所在:
{
xtype: 'container',
id: 'panel_side_bar',
margin: 5,
width: 250,
autoScroll:true,
layout: {
type: 'border'
},
region: 'west',
items: [
{
xtype: 'treepanel',
id: 'productos_panel',
title: 'Listado de Productos',
rootVisible:false,
autoScroll : true,
region: 'center',
root: getDirectJSON("<?php echo url_for("@get_categoria_prod",true)?>"),
viewConfig: {
id: 'productos'
},
listeners: {
itemclick: {
fn: evtClickItemTree
}
}
},
{
xtype: 'container',
height: 51,
id: 'botonera',
layout: {
type: 'vbox'
},
region: 'north',
items: [
text_input_filtro,
{
xtype: 'container',
id: 'contenedor_btns_filtro',
height: 25,
width:250,
layout: {
type: 'hbox'
},
items: [
{
xtype: 'button',
id: 'button_filtrar',
text: 'Filtrar',
handler: evtButtonFiltrar,
flex: 1
},
{
xtype: 'button',
id: 'button_mostrar_todo',
text: 'Mostrar Todo',
handler: evtButtonMostrarTodo,
flex: 1
}
]
}
]
}
谢谢大家。
I'm a problem with scrollbar in extjs 4.
The horizontal scrollbars don't show and the vertical scrollbars don't move. I test the code in google chrome, IE and firefox. The javascript don't show errors.
This is a part of code, in productos_panel is the problem:
{
xtype: 'container',
id: 'panel_side_bar',
margin: 5,
width: 250,
autoScroll:true,
layout: {
type: 'border'
},
region: 'west',
items: [
{
xtype: 'treepanel',
id: 'productos_panel',
title: 'Listado de Productos',
rootVisible:false,
autoScroll : true,
region: 'center',
root: getDirectJSON("<?php echo url_for("@get_categoria_prod",true)?>"),
viewConfig: {
id: 'productos'
},
listeners: {
itemclick: {
fn: evtClickItemTree
}
}
},
{
xtype: 'container',
height: 51,
id: 'botonera',
layout: {
type: 'vbox'
},
region: 'north',
items: [
text_input_filtro,
{
xtype: 'container',
id: 'contenedor_btns_filtro',
height: 25,
width:250,
layout: {
type: 'hbox'
},
items: [
{
xtype: 'button',
id: 'button_filtrar',
text: 'Filtrar',
handler: evtButtonFiltrar,
flex: 1
},
{
xtype: 'button',
id: 'button_mostrar_todo',
text: 'Mostrar Todo',
handler: evtButtonMostrarTodo,
flex: 1
}
]
}
]
}
Thanks for all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加此 Ext.override 可能会对您有所帮助。我在 Ext 论坛的某个地方找到了它,从那以后我没有注意到任何 TreeGrid 滚动条问题。如果您使用的是 MVC 结构,只需将其放入一些主要代码文件中,例如
app.js
:Adding this Ext.override might help you. I found it somewhere in the Ext forums and I haven't noticed any TreeGrid scrollbar issues since. Just throw it in some major code file, such as
app.js
if you're using the MVC structure:我发现这个问题通过在组件实例化后通过 javascript 设置溢出和高度来解决:
也许是一个拼凑,但它为我修复了 Ext 错误
I found that this problem was fixed for me by setting the overflow and height via javascript after the component was instantiated:
A kludge perhaps, but it fixes the Ext bug for me