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

Show pop up window from custom button click inside customeditortemplate

10 Answers 1659 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Anamika
Top achievements
Rank 1
Anamika asked on 16 Jul 2014, 11:42 AM
Hello,

I am referring to SchedulerCustomEditor Project and in CustomEdiotTemplate.cshtml file i am adding a button and on click of button i want to load another Pop up window with a grid. The Moment i add window open code in button click Event the custom Editor Pop up stops coming.
Atttached the

Attached my template file and TestClick Event to Show Pop up window

Thanks

Anamika

10 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 18 Jul 2014, 05:44 AM
Hi Anamika,

After inspecting the provided editor it appears that the current behavior is related to the following points:
  • unescaped "#" symbols in the editor - as this symbol is used by Kendo UI template syntax it should be escaped as it can break the template.
  • JavaScript comments in the editor - as the editor is minified to single row, using single-line JavaScript comments will break the template as all code after them will be commented.

 

Please check the updated code below:
function TestClick(e) {
    var direction = "Adress/AddAdress";
    var wnd = $("\\#window").data("kendoWindow");
    if (!wnd) {
        wnd = $("\\#AddAdress").kendoWindow({
            title: "test",
            actions: ["Close"],
            content: direction,
            width: "800px",
            height: "600px",
            visible: false,
            draggable: false,
            resizable: false,
            modal: true
        }).data("kendoWindow");
    }
    wnd.center();
    wnd.open();
};
Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anamika
Top achievements
Rank 1
answered on 21 Jul 2014, 08:53 AM
thanks that works
0
Anamika
Top achievements
Rank 1
answered on 22 Jul 2014, 09:10 AM
Hello I have another question. I have added a new field ObjectID and changed CustoEditorTemplate to have new field
<div class="k-edit-label">
@(Html.LabelFor(model => model.ObjectID))
</div>
<div data-container-for="title" class="k-edit-field">
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:objectID" }))

</div>
and in MeetingViewModel added ObjectID string property, but when a add new Task Meeting.ObjectID is always null in Insert even after data_bind
public virtual void Insert(MeetingViewModel meeting, ModelStateDictionary modelState)
{
0
Vladimir Iliev
Telerik team
answered on 22 Jul 2014, 09:25 AM
Hi Anamika,

Please note that only the fields that are part of the "ISchedulerEvent" interface are translated to lowercase on the client side - custom fields that you add to the model will be available as-is on the client side.

e.g.:
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:ObjectID" }))

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anamika
Top achievements
Rank 1
answered on 22 Jul 2014, 09:30 AM
changed to <div data-container-for="objectID" class="k-edit-field">
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:objectID" }))

</div>
but still do not get anything other than null. Also tried objectid all small
0
Anamika
Top achievements
Rank 1
answered on 22 Jul 2014, 09:40 AM
Also another strange Thing in CustomEditorSample is regular fields i see it used lower case but for Attendees and roomID it uses no lower case
<div data-container-for="Attendees" class="k-edit-field">
@(Html.Kendo().MultiSelectFor(model => model.Attendees)
.HtmlAttributes(new { data_bind = "value:Attendees" })
0
Vladimir Iliev
Telerik team
answered on 23 Jul 2014, 07:34 AM
Hi Anamika,

From the provided information it seems that you tried the opposite of what I asked you to try - instead of typing the custom field with capital letter you tried again with lower case which is invalid configuration. I would try to clarify my previous reply:
  • Fields that are part of the "ISchedulerEvent" should be typed with lower case in the editor template
  • All other fields (which are not part of the interface) should be typed as-is (in current case with capital letter) in the editor template

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anamika
Top achievements
Rank 1
answered on 23 Jul 2014, 08:04 AM
Ok thaks, i got it. But now facing another Problem. My requirement is ObjectID should be hidden field and another textfield for description and on a button click i choose object from another popup window and populate description and hidden field onject ID. On save should get objectid.
But with hiddenfield object id is always null . So i tried objectid as TextBox and populate a value on button click. Interesting is i see the 'hello' in the TextBox but when i click save objectid is null. But if i edit hello to hello1 or something just Need to edit and then click save then i get Objectid value.

Why so, populating in jquery does not make textbox dirty ?
here is the customeditortemplate code

<script>

function TestClick(e) {
$('input[name="txtObjectID"]').val('hello');
};



</script>
<div class="k-edit-label">
@(Html.LabelFor(model => model.ObjectID))
</div>
<div data-container-for="ObjectID" class="k-edit-field">
@(Html.TextBoxFor(model => model.ObjectID, new { @class = "k-textbox", data_bind = "value:ObjectID",Name="txtObjectID" }))
<input class="k-button" id="searchBtn" style="width:20px" type="button" value="...." onclick="TestClick(this)" />
</div>
Anamika
0
Vladimir Iliev
Telerik team
answered on 23 Jul 2014, 10:08 AM
Hi Anamika,

As this thread is out of the original topic, may I kindly ask you to open a new support thread for the Scheduler? In this way it is much easier to follow and concentrate on the particular issue which usually leads to its faster resolving.

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anamika
Top achievements
Rank 1
answered on 23 Jul 2014, 11:50 AM
sure am opening new ticket now, thanks
Tags
Scheduler
Asked by
Anamika
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Anamika
Top achievements
Rank 1
Share this question
or