ExtJS6: How to set leftpad margin to 0 for treelist items

心不动则不痛 提交于 2019-12-25 07:15:17

问题


I have a treelist working using ExtJS6 but since items are left padded automatically given their depth and text inside it gets truncated for third child and deeper. Since I use it as a menu, having fixed width. I need to remove auto calculated leftpad margin. I did not find anything useful while going through extjs api for treelist. Could anyone please help


回答1:


If you look at the code of treelist and treelistitem and abstract tree list item for a minute, you see that you can use the undocumented config property indent:0 or the method setIndent(0).

Not sure why it's not documented, presumably they intend to change the naming in future versions.

I have tested that it's working by opening the dashboard example, expanding the "pages" subtree, and then putting the following line into browser console:

Ext.ComponentQuery.query("treelist")[0].setIndent(0);


来源:https://stackoverflow.com/questions/38239872/extjs6-how-to-set-leftpad-margin-to-0-for-treelist-items

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!