How to fire programatically edit event?

5 posts, 0 answers
  1. Irving
    Irving avatar
    6 posts
    Member since:
    Jan 2016

    Posted 25 Jul Link to this post

    I have a grid, I want to fire the event edit like I'm clicking the edit button to fire the popup edit template, but without clicking it with the mouse but programatically. I this posible?

    I tried trigger it on the databound event like this:

     

    for (var i = 0; i < rows.length; i++) {

    if(Myid == theIdOntheRow)

    {

     $(rows[i]).addClass('k-state-selected');
                            var btnEdit = $(rows[i]).find(".k-grid-edit");                        
                            btnEdit.trigger('click');

     

    ...

     

    I hope there are a clenear way to do this. Thanks

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 26 Jul Link to this post

    Hello Irving,

    You could use the editRow method of the Grid API instead. It receives the DOM element of the row as a parameter.

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-editRow

    Regards,
    Dimiter Madjarov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Irving
    Irving avatar
    6 posts
    Member since:
    Jan 2016

    Posted 26 Jul Link to this post

    Thanks for you quick respose. This works really good. The problem I'm having is about when to fire this event. I have a Kendo MVC grid, if I call this on the Databound event it's loops causing a maximum stack size. If I call it in other moment I still don't have data.

     

    Thanks

  5. Irving
    Irving avatar
    6 posts
    Member since:
    Jan 2016

    Posted 26 Jul in reply to Irving Link to this post

    I found that I can call this on the RequestEnd event instant of the databound event. Thanks
  6. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 27 Jul Link to this post

    Hello Irving,

    Thank you for updating us.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET MVC is VS 2017 Ready