PDA

View Full Version : Sending Parameters



waqasaslammmeo
8 Mar 2012, 10:39 PM
Hello!
well i am trying to improve my self in extjs , now what i want to do is , i have a grid , a button and a textbox , now i want that after writing the recid in textbox and pressing the button my grid will show all the records of that id , or you can say i want to show conditional records in my grid , for this i have to send parameter to my webservice (i am using asp.net/c#) , so that i can get the filtered records , someone tell me that i have to send the parameters through store , and someone tell me that i have to send the parameters in the buttons handler event by using the post method and after that reload the store , but i tried both methods and i failed .

please guide me and help me , because you people are more experienced in it and all of you are my teachers..
Best Records.

M.Waqas Aslam

chramer
9 Mar 2012, 12:20 AM
If all your records are loaded in the store, you can use filters (filtering on the client side):


store.clearFilter();
store.filter([
Ext.create('Ext.util.Filter', {property: "recid", value: textbox.getValue(), root: 'data'}),
]);


you migh need some records that are not loaded in the store, you can do this..
and then filter the store on the server with the given parameter

store.load({
params : {
recid : textfield.getValue();
}
});

börn
9 Mar 2012, 12:43 AM
you can use a config remoteFilter on the store. Then it uses the same api (filter function on store for the filtering) and therefor its sending a filter parameter to the server (a hash with property value).

waqasaslammmeo
10 Mar 2012, 12:46 AM
thanks both of you for your time and help , i am really very thankful to you .
(thread is solved.)
God Bless You

Regards