Hello,
what is the best practises way to use custom forms for create and edit my events? I don't want use templates becouse I would like to use custom validation and dedesign of edit forms. If I call e.preventDefault() in edit function, scheduler returns error after second opening create form by double click in scheduler...
cancelEvent() function isn't too much elegant...
Any other possibilities?
Thanks David
what is the best practises way to use custom forms for create and edit my events? I don't want use templates becouse I would like to use custom validation and dedesign of edit forms. If I call e.preventDefault() in edit function, scheduler returns error after second opening create form by double click in scheduler...
cancelEvent() function isn't too much elegant...
Any other possibilities?
Thanks David
7 Answers, 1 is accepted
0
Hi David,
Kind Regards,
Vladimir Iliev
Telerik
In current scenario I would suggest to define the custom validation rules inside the model definition and use editor template:
schema: {
model: {
id:
"Id"
,
fields: {
Id: {
//this field will not be editable (default value is true)
editable:
false
,
// a defaultValue will not be assigned (default value is false)
nullable:
true
},
description: {
//set validation rules
validation: {
required:
true
,
//custom validation rule:
custom:
function
(input, params) {
if
(input.is(
"[name='description']"
)) {
if
(input.val() == undefined || input.val().length <= 0) {
return
false
;
}
}
//check for the rule attribute
return
true
;
}
}
},
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

David
Top achievements
Rank 1
answered on 09 Sep 2013, 01:09 PM
Hello Vladimir,
thanks for reply but I really need use my windows, forms and server validations. Now I'm using edit function in scheduler options call this.cancelEvent() and open my window but before I call this method kendo window is displayed. It isn't too much nice... Is better solution exists?
Thanks David
thanks for reply but I really need use my windows, forms and server validations. Now I'm using edit function in scheduler options call this.cancelEvent() and open my window but before I call this method kendo window is displayed. It isn't too much nice... Is better solution exists?
Thanks David
0
Hi David,
Vladimir Iliev
Telerik
In case you need to use another popup with custom form for editing events then you should implement a custom solution which to prevent the opening of the build-in popUp editor (you can use the edit event). Then you can open your custom window and finally use the scheduler API to save the new values (or post them to the server).
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Jsn
Top achievements
Rank 1
answered on 11 Sep 2013, 09:24 AM
Hi David,
I also had this problem a days ago,. when you use e.preventDefault() inside edit event the scheduler window will not show up but on the second time
you double click to add new schedule events, edit will never get fired.. So, what I did is hide the scheduler window by adding the style attribute to the "k-window" to "visibility:hidden!important" inside the edit event.. Here's the code snippet.
Hope this help..
Regards,
Jesson
I also had this problem a days ago,. when you use e.preventDefault() inside edit event the scheduler window will not show up but on the second time
you double click to add new schedule events, edit will never get fired.. So, what I did is hide the scheduler window by adding the style attribute to the "k-window" to "visibility:hidden!important" inside the edit event.. Here's the code snippet.
edit: function (e) {
$('.k-window').attr("style", "visibility:hidden!important");
// add your code here to show your custom form.
}
Hope this help..
Regards,
Jesson
0
Accepted
Hello Jesson,
Georgi Krustev
Telerik
The described problem is caused by a JavaScript error thrown on second attempt to edit event. This issue is addressed in the latest internal build available only to paid license holders.
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

David
Top achievements
Rank 1
answered on 11 Sep 2013, 10:22 AM
Hi Jasson,
thanks. I solved this problem similarly like you but if you need cancel editing because user hasn't permission to edit is better use preventDefault. Like Georgi Krustev wrote, there is a bug in version v2013.2.716. Downloading last internal build solves my problem with this bug...
Regards
-David
thanks. I solved this problem similarly like you but if you need cancel editing because user hasn't permission to edit is better use preventDefault. Like Georgi Krustev wrote, there is a bug in version v2013.2.716. Downloading last internal build solves my problem with this bug...
Regards
-David
0

Jsn
Top achievements
Rank 1
answered on 11 Sep 2013, 10:38 AM
oh, I see.. Thanks for the info. By the way I was using the trial version of kendo UI for now.. I'll have it a try as soon as I got the paid license..