-
7 Oct 2011 10:46 PM #1
Answered: Search inside extjs tree store
Answered: Search inside extjs tree store
I have a text field in my tree toolbar that should take a string from a user then search that through a specific column of tree. I use store filter but there is a problem in my code and I dont know what it is. thanks for help. This is my code:
Erropr: RegEx is not DefinedPHP Code:var onSimpleSearch = function(){
var searchStr= Ext.getCmp('searchField').getValue();
if(searchStr){
var tree = Ext.getCmp('infra_tree');
var tstore = tree.getStore();
var searchReg = new RegExp(searchStr, 'g');
console.log(searchReg);
tstore.filter({property:"ipadd", value:searchStr});
}else {
Ext.MessageBox.show({
title: 'Nothing to search',
msg: 'Search string is empty',
icon : 'ext-mb-info',
buttons: Ext.MessageBox.OK
});
}
};
-
Best Answer Posted by mankz
TreeStore has no 'filter' method, you'll need to use cascadeBy(fn) on the root node for now.
-
10 Oct 2011 4:08 PM #2
Get a stacktrace using Firebug or the Chrome Developer Tools. Should tell you what line the error happens on.
-
11 Oct 2011 3:53 AM #3Sencha - Community Support Team
- Join Date
- Nov 2007
- Location
- Helsingborg, Sweden
- Posts
- 2,494
- Vote Rating
- 57
- Answers
- 30
TreeStore has no 'filter' method, you'll need to use cascadeBy(fn) on the root node for now.
-
12 Oct 2011 3:46 AM #4
OK, thanks for reply.
We will appreciate if extjs development team implement this feature in future


Reply With Quote