Doubleclick and navigate to another view

8 posts, 0 answers
  1. Mark
    Mark avatar
    61 posts
    Member since:
    Dec 2010

    Posted 09 Jun 2014 Link to this post

    We are using the paid version with the razor engine.

    I am looking for an example of being able to doubleclick a gridrow, get the ID from a nonvisible column and pass that value to the controller.

    Might I suggest that you add filtering (paid version/razor/html) to the forum. For beginners in MVC it is difficult to locate a relevane example/response.
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2288 posts

    Posted 09 Jun 2014 Link to this post

    Hello Mark,


    To achieve this you could bind to the dblclick event of the Grid rows, retrieve the associated model with the dataItem method of the Grid API and pass it to the controller.
    E.g.
    $("#grid tbody").on("dblclick", "tr[role='row']", function (e) {
        var grid = $("#grid").data("kendoGrid");
        var model = grid.dataItem(this);
     
        //invoke controller
    });

    I hope this information helps.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Mark
    Mark avatar
    61 posts
    Member since:
    Dec 2010

    Posted 12 Jun 2014 in reply to Dimiter Madjarov Link to this post

    Thanks Dimiter - that worked when using Ajax as the datasource for the grid. I had to change to Server datasource (json circular reference from EF killed json) and the row does not have the [role='row'] and therefore does not fire.

    Removing the role attribute allows the event to bind/fire correctly but I get the error TypeError: Cannot read property '1' of undefined   1 being the ID value of the dataitem. How do I add the roel attribute or deal with the type error.
  4. Mark
    Mark avatar
    61 posts
    Member since:
    Dec 2010

    Posted 12 Jun 2014 in reply to Mark Link to this post

    Correction 1 is the index of the selected row
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2288 posts

    Posted 13 Jun 2014 Link to this post

    Hi Mark,

    When server bound dataSource is used, there is no dataItem associated to the items, since no data is stored on the client side. 

    Regarding the serialization error, you could take a look at the following page, which demonstrates the possible resolutions.

    Regards,
    Dimiter Madjarov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Mark
    Mark avatar
    61 posts
    Member since:
    Dec 2010

    Posted 13 Jun 2014 in reply to Dimiter Madjarov Link to this post

    Thanks
    With the help of a collegue I resolved this, the circular reference was caused by EF navigation items, removing them allowed me to use the Ajax datasource and the data item appeared.
  7. ajith
    ajith avatar
    21 posts
    Member since:
    Apr 2015

    Posted 23 Apr 2015 in reply to Dimiter Madjarov Link to this post

    Hi Dimiter,

     I want Popup a Grid View when doubleclick on a textbox. can u help me?

     

  8. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2288 posts

    Posted 23 Apr 2015 Link to this post

    Hello Ajith,

    What is the exact issue that you are experiencing? Have you tried the previously suggested approach?

    Please elaborate further.

    Regards,
    Dimiter Madjarov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top