Show pop up window from custom button click inside customeditortemplate

11 posts, 0 answers
  1. Anamika
    Anamika avatar
    157 posts
    Member since:
    Mar 2014

    Posted 16 Jul 2014 Link to this post

    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
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 18 Jul 2014 Link to this post

    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!
     
  3. Anamika
    Anamika avatar
    157 posts
    Member since:
    Mar 2014

    Posted 21 Jul 2014 in reply to Vladimir Iliev Link to this post

    thanks that works
  4. Anamika
    Anamika avatar
    157 posts
    Member since:
    Mar 2014

    Posted 22 Jul 2014 in reply to Vladimir Iliev Link to this post

    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)
    {
  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 22 Jul 2014 Link to this post

    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!
     
  6. Anamika
    Anamika avatar
    157 posts
    Member since:
    Mar 2014

    Posted 22 Jul 2014 in reply to Vladimir Iliev Link to this post

    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
  7. Anamika
    Anamika avatar
    157 posts
    Member since:
    Mar 2014

    Posted 22 Jul 2014 in reply to Anamika Link to this post

    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" })
  8. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 23 Jul 2014 Link to this post

    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!
     
  9. Anamika
    Anamika avatar
    157 posts
    Member since:
    Mar 2014

    Posted 23 Jul 2014 in reply to Vladimir Iliev Link to this post

    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
  10. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 23 Jul 2014 Link to this post

    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!
     
  11. Anamika
    Anamika avatar
    157 posts
    Member since:
    Mar 2014

    Posted 23 Jul 2014 in reply to Vladimir Iliev Link to this post

    sure am opening new ticket now, thanks
Back to Top