View Full Version : Extjs, filter tree.Panel by record.data.id

27 Oct 2013, 5:57 AM
I know there are many things about this item, but i can't do my job and if you can give me some advice , please help me, my task is following: I have tree

var myTree = Ext.create('App.Tree', {
listeners: {
itemclick: {
fn: function(view, record, item, index, event) {
console.log( record.data.id); }
my goal is display, show nodes which's data.id is for example 5.. i know there is filterBy function for this but..

Gary Schlosberg
30 Oct 2013, 9:40 AM
What do you mean by displaying only node id 5? Seems like using filterBy on the store would be much easier, but since you put the listener on the click I'm guessing there is a reason? So clicking on the node makes all others disappear?

30 Oct 2013, 11:11 AM
my tree store is't static, nodes have some other datas, record.data.id,record.data.someId.. storeLoad method loads all data, and i want to display only some of them(with their chilldrens).and with itemclik i wanted to show record.data.id..reality i have combo, and when i will choose one row,the explicit tree have to open in window..sorry form my english

Gary Schlosberg
30 Oct 2013, 3:40 PM
Have you seen this?

Perhaps you could get it working with your combo.

Gary Schlosberg
31 Oct 2013, 8:55 PM
Here's a tree filtering example I came across that might also be helpful for you: