PDA

View Full Version : regarding grid-filter: not usual



extonly
3 Jun 2007, 11:24 PM
Hi Jack and all,

First of all thanks for creataing ext.

I am working on a javascricpt based project and I have included some ext components too.
Now I want to filter an ext grid. Actually I am looking at some thing like filter components are placed at west region and grid will be populated at center region. I have gone through almost all the posts regarding grid but nowhere I found an example/thread of like this. In all the examples/tutorials, the filter components are made along with the grid body. I would not like to attach the filter to the grid body, want to seperate it out.

If some body has an idea please do respond.
please dont redirect me to previous threads, because I have already checked out all those things.

Thank you,
An ext lover.

jsakalos
4 Jun 2007, 2:21 AM
I you mean server side filtering the principle is same as if the filter is below the grid's body. I've posted some code of filter implementation here: http://extjs.com/forum/showpost.php?p=30948&postcount=21. The client side filtering would be similar; you would just grabbed you filter value and passed it to the grid's store filter method.

Hope this helps.

noname
4 Jun 2007, 3:38 AM
yaa I did mean server side filtering.

According to the code u posted, the filter will come along with the grid. Right

I think you have not clearly read my post:


Actually I am looking at some thing like filter components are placed at west region and grid will be populated at center region. I have gone through almost all the posts regarding grid but nowhere I found an example/thread of like this. In all the examples/tutorials, the filter components are made along with the grid body. I would not like to attach the filter to the grid body, want to seperate it out.

west and center means west region and center region of the lay out.

Thanks anyways.

Expecting your reply.

jack.slocum
4 Jun 2007, 3:51 AM
Use the values in your form as "baseParams" (e.g. store.baseParams = {foo:1, bar:2} ) for your data store. Then load() the the store. The form values will be passed to your server script and you can do the filtering.

jsakalos
4 Jun 2007, 4:57 AM
yaa I did mean server side filtering.

According to the code u posted, the filter will come along with the grid. Right

I think you have not clearly read my post:


west and center means west region and center region of the lay out.

Thanks anyways.

Expecting your reply.


Well, that code is part of the grid, you're right. However, I meant is as an idea not as a copy-paste-work thing. You'll listen to the grid's store beforeload event in which you add baseParam or params with filter values. The advantage of this approach is in that that if you have paging grid you read filter values on each "next", "previous" clicks so you page through the filtered results. That is the basic idea and it is also in that code.

Maybe it works for you or you can use Jack's advice and load grid's store manually with filter values in baseParams.

PS: I have read and understood your post. The location of filter fields is irrelevant as long as you have references to them. They can be even in a (hidden) dialog.

extonly
6 Jun 2007, 10:48 PM
Hi

sorry for being belated,

I tried Jack's Idea, It is working, Thanks a lot JAck,

I will try Jozef Sakalos idea too and will let you inform about the results.
Thank you for that bit of information,