This is a migrated thread and some comments may be shown as answers.

preventDefault() in kendo grid not working

9 Answers 1165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Muthu
Top achievements
Rank 1
Muthu asked on 11 Oct 2012, 04:59 AM
e.preventDefault() is not working in requeststart event of kendo grid.any help

9 Answers, 1 is accepted

Sort by
0
Brian Roth
Top achievements
Rank 1
answered on 01 Nov 2012, 03:39 PM
I'm seeing this too in some code where I'm trying to prevent re-binding of the grid when there is unsaved data.  Does anybody have a solution or workaround for this?  Thanks!

Brian
0
Dino
Top achievements
Rank 1
answered on 06 Nov 2012, 08:06 PM
I'm having the same issue...


Anyone??
0
Brian Roth
Top achievements
Rank 1
answered on 28 Nov 2012, 10:33 PM
Bumping this to see if anyone has an answer.  Much appreciated!

Brian
0
Atanas Korchev
Telerik team
answered on 29 Nov 2012, 07:16 AM
Hello,

 We are not really sure what you are trying to achieve. Please elaborate on the requirements.

 Generally speaking the data binding of the grid cannot be prevented. 

Regards,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brian Roth
Top achievements
Rank 1
answered on 29 Nov 2012, 07:55 PM
Hi Atanas,

I'm not sure if everyone else is dealing with the same thing, but here is my situation:

I have an ajax bound grid with sorting, paging, and filtering enabled.  The grid is batch editable with inline editing.  Currently if the user edits the grid and the does a sort/page/filter operation the grid will make a call back to our database to retrieve the data and any updates the user already made will be lost.  I was looking for a way to pop up a javascript confirm dialog along the lines of "Any unsaved changes will be lost.  Are you sure you want to continue?"  I currently have that dialog in the data source RequestStart event and am trying to do a preventDefault() there to stop the data source from rebinding, but from what you're saying it seems like that won't work.  Do you have any suggestions as to other ways that I might be able to achieve my desired functionality?  Or is this something that would need to be entered as an enhancement request for a future release of Kendo?

Thanks for your help!

Regards,
Brian
0
Rosen
Telerik team
answered on 03 Dec 2012, 01:38 PM
Hi Brian,

I'm afraid cancelling the requestStart event is currently not supported. However, we have added this enhancement, thus this will be possible with the next internal build.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brian Roth
Top achievements
Rank 1
answered on 03 Dec 2012, 10:26 PM
Excellent!  Thanks for the quick response.  I look forward to the updated build.
0
Tim Eck
Top achievements
Rank 1
answered on 15 Jun 2013, 12:07 AM
Hi Rosen,
I'm trying to use e.preventDefault() but still not working do you know if this is something that should be working by now? We are using this version of Kendo.UI 2012.3.1114.340
0
Rosen
Telerik team
answered on 17 Jun 2013, 05:55 AM
Hello Tim,

The version you have mentioned is older than this post. Thus, you should try a newer version, for example the most recent one - Q1 2013 SP1.

Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Muthu
Top achievements
Rank 1
Answers by
Brian Roth
Top achievements
Rank 1
Dino
Top achievements
Rank 1
Atanas Korchev
Telerik team
Rosen
Telerik team
Tim Eck
Top achievements
Rank 1
Share this question
or