Disable postback on filter selection

5 posts, 0 answers
  1. vikas
    vikas avatar
    1 posts
    Member since:
    May 2009

    Posted 13 May 2009 Link to this post

    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.
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 16 May 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ross
    Ross avatar
    3 posts
    Member since:
    Sep 2008

    Posted 25 Jun 2009 Link to this post

    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
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 29 Jun 2009 Link to this post

    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.
  6. Ajay
    Ajay avatar
    66 posts
    Member since:
    May 2009

    Posted 19 Mar 2010 Link to this post

    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.


Back to Top
UI for ASP.NET Ajax is Ready for VS 2017