经反复测试,终于搞出了办法来更改treePanel的行高.
解决如下:
方法一:这个比较简单了,直接更改CSS样式,找到ext-all.css,搜索 x-grid-row 这个是行高tr所用的css,其下还有td,img的样式,按需更改即可。
方法二:在ExtJs4.0中代码更改,这个是实际是取出DOM元素tr,更改其css样式中的height.
代码如下--
afterrender:function(ths,e)
{
nodes=Ext.getDom(ths).getView().getNodes(); //得到所有的节点
Ext.Object.each(nodes, function(key, item, myself) { //节点循环
//alert(key + ":" + item);
item.style.height='23px'; // item 即 得到的tr对象。。
alert(item.className); // 显示x-grid-row
});
}
暂时想到这两个办法,欢迎指点~~ ^_^