Inviting user before paging Kendo grid

Advertisement

Is there a way to create something like "Are you sure?" when the user tries to define a kendo grid.

However, there is no event like "beforePaging" or something.

I found this question with the same problem, but the answer does not make me anything (using requestStart).

I tried adding an event listener for pagination buttons and it went fine but I can not cancel the pagination event because it is not directly related to pagination:

 $(document).on("click", ".k-pager-numbers li a", function (e) { e.preventDefault(); alert("Handler for .click() called"); }); 

The above is called, but preventDefault does not prevent pagination, because e is not the actual pagination event.

The answer

There is now an appropriate or appropriate way to do this, but you can use the code below. Switch on the StartSource request event.

 requestStart: function(e) { if (e.type == "read" && this.hasChanges()) { if (confirm("You need to fill information before...") == false) { e.preventDefault(); e.stopPropagation(); } } },