Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prevent kendo ui grid popup editor from closing on insert (asp.net mvc)

Im using kendo ui asp.net mvc Grid in my project.

is there a way to keep popup editor open when inserting new data?

like image 767
Ashkan Nourzadeh Avatar asked Oct 31 '22 16:10

Ashkan Nourzadeh


1 Answers

Interesting question, made me want to try and implement this.

Attach an event handler to the Save event. This should be called when the 'update' button is clicked.

 .Events(x => x.Save("SaveChanges"))

The event that closes the window is the dataBinding event of the grid so we are going to prevent that from happening.

function SaveChanges() {

alert("SaveChanges-Fired");

var grid = $("#GridName").data("kendoGrid");

    grid.bind("dataBinding",function(e){
       e.preventDefault();
   })
}
like image 106
CSharper Avatar answered Jan 04 '23 13:01

CSharper