PDA

View Full Version : problem about filtering tree



bluefire1128
24 Aug 2009, 5:22 AM
Hi:

I extend the treepanel?it has an textfield (in tbar) to filter the treepanle.
and I extend the comboBox?its list is my extend treepanel.

when I put the extended combox and the extended treepanel in same page?there are 2 problems:
1.the tbar of the extended treepanel in the extended comboBox can't be showed in fire fox,chrom,but can be showed in IE;
2.if the extended comboBox's list is showed,when i input something in the extend treepanel's tbar,it filtered the comboBox's list,it confused me.

ANYBODY who can help me?
I am a newer to javascript and know just a little english,sorry.

bluefire1128
24 Aug 2009, 9:29 PM
hello

Animal
24 Aug 2009, 9:34 PM
Why did you extend?

Because you saw some code taht did, and copied it?

It's likely that extending to configure is the cause of your problems.

bluefire1128
24 Aug 2009, 11:34 PM
thanks for Animal's support.
extended treepanel:

Ext.ns('Ext.xx');
Ext.xx.basicTree = Ext.extend(Ext.tree.TreePanel,{
...
basictree = this;
this.tbar = new Ext.Toolbar(
{
items : [new Ext.form.TextField(
{
...
listeners :
{
render : function(f)
{
//the function filterTree like the Ext DOC's home page left side tree filter
f.el.on('keydown', basictree.filterTree, f,{buffer : 350});
}
}
})]
});
...
})


Extended comboBox:
Ext.xx.comboTree = Ext.extend(Ext.form.ComboBox,
{
...
tree = new Ext.xx.basicTree({...});
...
}

Animal
24 Aug 2009, 11:42 PM
Why did you extend? Why did you not just use



tree = new Ext.tree.TreePanel({
tbar: [{
xtype: 'textfield',
...
}]
...
});
?

bluefire1128
25 Aug 2009, 5:00 PM
I do it just for learing and priactise.