[CLOSED] MVC Razor GridPanel Row DoubleClick

  1. #1

    [CLOSED] MVC Razor GridPanel Row DoubleClick

    Hi,

    I have a GridPanel in my view that I want to "wire-up" the row double-click event for.

    Whenever the user double clicks a row on the grid, I want to call a Direct Event on my controller and pass the Id (in the extra parameter?). This Id is the record id (and a hidden column in the grid).

    Can you provide some sample code (MVC and Razor) to do this?

    Thanks,
    Leo
    Last edited by Baidaly; Jul 25, 2013 at 12:15 AM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by leonardm View Post
    Hi,

    I have a GridPanel in my view that I want to "wire-up" the row double-click event for.

    Whenever the user double clicks a row on the grid, I want to call a Direct Event on my controller and pass the Id (in the extra parameter?). This Id is the record id (and a hidden column in the grid).

    Can you provide some sample code (MVC and Razor) to do this?

    Thanks,
    Leo
    I figured it out: Here's the code fragment

    @(X.GridPanel()          
              .Layout(LayoutType.Fit)         
              .Border(false)
              .BodyBorder(0)
              .DirectEvents(de =>
                    {
                        de.ItemDblClick.Url = "/List/Details";
                        de.ItemDblClick.CleanRequest = true;
                        de.ItemDblClick.Method = HttpMethod.GET;                   
                        de.ItemDblClick.ExtraParams.Add(new Parameter("id", "record.get('Id')", ParameterMode.Raw));
                    })
    
    ....
    Last edited by Baidaly; Jul 25, 2013 at 12:14 AM.
  3. #3
    Hello!

    Thank you for your update and solution. Please, don't forget to wrap your code in CODE tag.

    Thank you!

Similar Threads

  1. [CLOSED] Prevent row doubleclick on specific column
    By CarWise in forum 2.x Premium Help
    Replies: 2
    Last Post: Jul 15, 2013, 3:45 PM
  2. Replies: 2
    Last Post: Jul 02, 2012, 7:15 PM
  3. [CLOSED] [Razor] Add GridView to GridPanel in razor
    By boris in forum 2.x Premium Help
    Replies: 3
    Last Post: May 09, 2012, 5:23 PM
  4. Replies: 17
    Last Post: Feb 02, 2011, 7:47 PM
  5. How to add a doubleclick event in texfield?
    By Barbar in forum 1.x Help
    Replies: 0
    Last Post: Oct 17, 2008, 1:58 PM

Tags for this Thread

Posting Permissions