This is a migrated thread and some comments may be shown as answers.

Disable postback on filter selection

4 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vikas
Top achievements
Rank 1
vikas asked on 13 May 2009, 01:29 PM
Hi...

I need to disable the post back operation that occurs when selecting any default expression from the Filter Menu.
But i need the the filter menu and its selection to persist throughout so that i can use it later to apply custom filter.
Any help in this regard.....

btw, i am implementing multi column filtering for which this is required.

Thanks.

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 16 May 2009, 10:59 AM
Hello Vikas,

You can achieve your goal if you wire the OnCommand client event of the grid and in its handler to check whether the command name is "Filter". If this condition is satisfied you can cancel the event.

Here is a code snippet describing the suggested approach:

[ASPX]:
<ClientEvents OnCommand="GridCommand"/> 

[Javascript]:
            function GridCommand(sender, args)  
            { 
                if (args.get_commandName() == "Filter")  
                { 
                    args.set_cancel(false); //stops the filter command 
                }               
            }

Greetings,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ross
Top achievements
Rank 1
answered on 25 Jun 2009, 03:16 PM
Hi, 

    I'm trying to implement this same functionality. First off, it's set_cancel(true) to cancel the event. Also, when using using this approach, the filter menu selection is not persisted as the original poster requested. Any Ideas?


Thanks
0
Georgi Krustev
Telerik team
answered on 29 Jun 2009, 03:50 PM
Hello Ross,

Please excuse me for the missunderstanding.

To cancel fired command you need to call args.set_cancel(true) method. Thus the command will be canceled and the chosen value will be persisted. Here is the correct implementation of the suggested approach:
            function GridCommand(sender, args)   
            {  
                if (args.get_commandName() == "Filter")   
                {  
                    args.set_cancel(true); //stops the filter command  
                }                
            } 

Regards, Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ajay
Top achievements
Rank 2
answered on 19 Mar 2010, 11:58 AM
Hi Georgi Krustev !

I had done the same that you have provided in your post below , but the problem here is that now Iam not able to FILTER my results.

All I want here is to FILTER my column without any postback .

But right now filtering is also being disabled ?

Please help.


Tags
Grid
Asked by
vikas
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Ross
Top achievements
Rank 1
Ajay
Top achievements
Rank 2
Share this question
or