Is there a way to only show parent nodes in a extjs tree
问题 I want to show only parent nodes of a tree in extjs. In my datastore there are leaf nodes as well. The output should be like - Folder 1 Folder 1.1 Folder 2 Folder 3 回答1: Create a filter object that gets only parent nodes and add it to the store config: E.g. filter for parent nodes only: var nodeFilter = new Ext.util.Filter({ property: 'leaf', value : false }); Putting it on the treestore config: var yourTreeStore = Ext.create('Ext.data.TreeStore', { // other configs ... filters: [nodeFilter]