New Insert after Insert or Update

6 posts, 0 answers
  1. Alessandro
    Alessandro avatar
    3 posts
    Member since:
    Aug 2015

    Posted 28 Oct Link to this post

    Hi, 

    I've a grid with a custom editor template.

    I need to open a new popup for a new record insert after the user updated o inserted the record before by clicking on a dedicated button

    How can I do that?

  2. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 01 Nov Link to this post

    Hi Alessandro,

    You can use the requestEnd event handler of the grid DataSource instance to achieve this requirement:
    http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-requestEnd

    You can check its type argument and if it equals "update", you can use the client-side API of the grid widget to open a new insert form or edit a given record:
    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-addRow

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Alessandro
    Alessandro avatar
    3 posts
    Member since:
    Aug 2015

    Posted 02 Nov in reply to Eyup Link to this post

    Hi,

    thank you for your answer, but the DataSource's event requestEnd is fired only ones at grid loaded.

  5. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 04 Nov Link to this post

    Hi Alessandro,

    It should be raised on other actions as well. Alternatively, you can also experiment with the change event handler:
    http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#events-change

    Regards,
    Eyup
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
  6. Alessandro
    Alessandro avatar
    3 posts
    Member since:
    Aug 2015

    Posted 04 Nov in reply to Eyup Link to this post

    Hi,
    thank you, now it works.
    But when i do this:
    var grid = $("#grid").data("kendoGrid");
    grid.addRow();

    I find a new empty line on the grid and the pop-up doesn't appear
    I've already configured the grid for editing in popup mode
    Thank you

  7. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 08 Nov Link to this post

    Hi Alessandro,

    Generally, the method should work as expected:
    http://dojo.telerik.com/eteWA/2

    You can enable your script debugger (FireBug or F12) and see whether there are any script errors interfering.

    Regards,
    Eyup
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready