PDA

View Full Version : Building a dynamic search on grid panel



buhari
31 Jan 2013, 7:39 AM
Hi everyone,

I have been working on a search component to be build around a grid panel that will dynamically drop down grid column as its menu item and search the records in the grid without success.

Please your assistance is highly appreciated.

Thanks

mitchellsimoens
4 Feb 2013, 9:15 AM
what do you mean by drop down grid column?

buhari
4 Feb 2013, 11:02 PM
For instance if I have a grid with name, department, faculty, grade as the column, the search component should dynamically use these as its items to look up the table. The search should be pluggable to any grids

Thanks for you anticipated support.

mitchellsimoens
5 Feb 2013, 7:04 AM
I'm not sure the UI you want.

AssetWorks
5 Feb 2013, 10:31 AM
Are you saying that you want a search bar that would filter your store by the all the fileds(columns) in your grid?

if so...

filterStore: function(searchtext){
grid.store.filterBy(function(r){
var val = searchtext.getValue().toLowerCase();
var rec = r.get('Attribute').toLowerCase();
return rec.indexOf(val) > -1;
});

}

rupamkhaitan
28 Mar 2013, 1:30 AM
In the code do you dynamically pass Attribute?
I mean i want minimal code which goes and look all the columns inside a grid and match with the search text

AssetWorks
28 Mar 2013, 5:41 AM
at the moment I'm only using this search on a grid with one column so I never needed to do that, however, have you seen saki's gridsearch plugin?
http://gridsearch.extjs.eu/