0
Q
水平滚动
A
回答
0
我有一些解决方法。见下面的代码。
afterrender: function() {
var view = this.getView();
var c = view.container;
var e = view.el;
var max = 0;
Ext.each(e.query('.x-grid-cell-inner'), function(el) {
el = Ext.get(el);
var size = el.getPadding('lr');
Ext.each(el.dom.childNodes, function(el2){
if (el2.nodeType == 3) {
size += 6 + el.getTextWidth(el2.nodeValue);
} else {
size += Ext.get(el2).getWidth();
}
});
max = Math.max(max, size);
});
max += c.getPadding('lr');
if (c.getWidth() < max) {
c.dom.style.overflowX = 'scroll';
e.setWidth(max);
e.down('table').setWidth(max);
}
}
您只需要将此监听器添加到您的TreePanel
。基本上它找到更宽的元素的宽度和扩展表的宽度,在容器上切换溢出。
相关问题
- 1. 水平滚动
- 2. 水平滚动?
- 3. 水平滚动
- 4. 水平滚动
- 5. 水平滚动+滚动条
- 6. 水平滚动dataTables.js
- 7. UICollectionView水平滚动
- 8. UITextView - 水平滚动?
- 9. jscrollpane - 水平滚动
- 10. 水平滚动Div
- 11. CFGRID水平滚动
- 12. jQuery水平滚动?
- 13. Safari水平滚动
- 14. 水平滚动TextView
- 15. UICollectionView水平滚动
- 16. 水平滚动? javascript
- 17. 水平滚动css?
- 18. 水平滚动表
- 19. html水平滚动
- 20. 水平滚动ViewPager
- 21. 水平滚动jquery
- 22. Android:TextView水平滚动
- 23. iPhone水平滚动
- 24. SurfaceView水平滚动
- 25. Highcharts水平滚动
- 26. Android水平滚动
- 27. 水平滚动UITableView
- 28. Rmarkdown水平滚动
- 29. CSS水平滚动
- 30. 水平滚动ItemsControl