Pop-up editor: Refresh grid after saving edits?

7 posts, 0 answers
  1. Mike
    Mike avatar
    9 posts
    Member since:
    Aug 2012

    Posted 05 Sep 2012 Link to this post

    Hello,
    How can I force the grid to refresh after saving an edit using your pop-up editor? 

    After a user saves a new or edited record, its data is encrypted and passed to the database.  When we return to the grid, the new records data is displayed in its encrypted form, but the other records display properly.  After I hit the refresh button on the grid, everything displays properly.  This is the issue that I am trying to correct.

    I would appreciate your help and suggestions,
    Mike
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 11 Sep 2012 Link to this post

    Hello Mike,

    I am not sure why exactly the new record is displayed in encrypted form, however you could rebind your grid with the help of the requestEnd event of the dataSource.
    e.g.
    function onGridDataSourceRequestEnd(e){
        if(e.type=="update")
        {
             this.read();
        }
    }

    Please notice the requestEnd event is only available in the latest internal build - it will be introduced in the next official release.

    Also do not hesitate to send a sample project which replicates the encrypting issue you experience so we can search for some other solution.


    Kind regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. American Eagle
    American Eagle avatar
    2 posts
    Member since:
    Feb 2009

    Posted 29 Apr 2013 Link to this post

    Please reply to:  v-daughw-oxf@ae.com

    I cannot get the requestEnd event to fire at all with Kendo MVC build  2013.1.319.340 .  WHY???????

    <script>

     //can't get this to fire to display success/fail msg
    function onRequestEnd(e) {

    debugger

    //Check request type
    if (e.type == "create" || e.type == "update") {
    //check for errors in the response
    if (e.response == null || e.response.Errors == null) {
    $('#PivotGrid').data().kendoGrid.dataSource.read();
    alert("Update Successful");
    }
    else {
    alert("Update Failed");
    }
    }
    }



     


    </script>


    <div align="center">

     @(Html.Kendo().Grid<PivotRow>()
    .Name("PivotGrid")
    .HtmlAttributes(new { align = "center", style = "height:600px; width:75%" })
    .Scrollable()
    .Sortable()
    .Navigatable()
    .Columns(columns =>
    {
    columns.Bound(c => c.us_price).Width(90).Title("US Price");
    columns.Bound(c => c.us_base_pricepoint).Width(90).Title("US Base Price").Hidden();
    columns.Bound(c => c.canada_price).Width(90).Title("Canada Price");
    columns.Bound(c => c.mexico_price).Width(90).Title("Mexico Price");
    columns.Bound(c => c.what_system).Width(100).Title("What System").Hidden();
    //columns.Bound(c => c.what_system).Width(90).EditorTemplateName("_DDL_BM");
    columns.Command(command => command.Destroy()).Width(50);

    })
    .Editable(editing => editing.Mode(GridEditMode.InCell))
    // Command configuration
    .ToolBar(toolbar =>
    {
    toolbar.Create();
    toolbar.Save();
    })
    .Events(e => e.SaveChanges("saveChanges"))
     .DataSource(dataSource => dataSource
    .Ajax()
    .Batch(true)
     // Specify property that is the unique identifier of the model
    .Model(model => model.Id(c => c.us_base_pricepoint))
    .Model(model =>
    {
     model.Field(c => c.what_system).DefaultValue("BM");
    })
    .Events(events =>
    {
      events.RequestEnd("onRequestEnd"); //can't get this to fire!
    events.Error("error");
    })
    .Create(create => create.Action("PricePoint_Create", "AE_IB_LOOKUP_VAL"))
    .Read(read => read.Action("PricePoint_Read", "AE_IB_LOOKUP_VAL"))
    .Update(update => update.Action("PricePoint_Update", "AE_IB_LOOKUP_VAL"))
    .Destroy(destroy => destroy.Action("PricePoint_Destroy", "AE_IB_LOOKUP_VAL"))
    )
    )
     
  5. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 02 May 2013 Link to this post

    Hello Mike,

    On my side the requestEnd event is triggered as expected. Are there any JavaScript errors in the console when initialzing the Grid?

    If not put this into a small project and send it here or in a support ticket so we can take a closer look over the case.

    Kind Regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. B V Siva Ram Kumar
    B V Siva Ram Kumar avatar
    1 posts
    Member since:
    Oct 2014

    Posted 04 Nov 2014 in reply to American Eagle Link to this post

    you have to call like this
    .Events(events => events.Error("error_handler").RequestEnd("requestend_handler"))
    don't use semi colon
  7. B V Siva Ram Kumar
    B V Siva Ram Kumar avatar
    1 posts
    Member since:
    Oct 2014

    Posted 04 Nov 2014 in reply to American Eagle Link to this post

    you have to write code like this
    .Events(events => events.Error("error_handler").RequestEnd("requestend_handler"))
    Don't use semi colon
  8. Kelso
    Kelso avatar
    36 posts
    Member since:
    Dec 2013

    Posted 27 Feb 2015 in reply to Petur Subev Link to this post

    Which version is requestEnd in?
Back to Top
UI for ASP.NET MVC is VS 2017 Ready