Editable.destroy = false not work in popup details

5 posts, 1 answers
  1. Inelcis
    Inelcis avatar
    6 posts
    Member since:
    Dec 2013

    Posted 20 Jan 2014 Link to this post

    If I disable edit.destroy, in popup details the delete button is still visible...
    To solve the problem, I remove the button in the edit event, but is there any another solution? Am I doing something wrong?

    <!-- JAVASCRIPT -->
    $(function () {
            $("#scheduler").kendoScheduler({
                startTime: new Date("2013/1/1 00:00"),
                editable: {
                    template: $("#editor").html(),
                    destroy: false,
                    update: true,
                    create: false,
                    confirmation: false
                },
                date: new Date(),
                workDayStart: new Date("2013/1/1 09:00"),
                workDayEnd: new Date("2013/1/1 19:00"),
                height: 500,
                timezone: "Etc/UTC",
                views: [
                    "day",
                    "week",
                    { type: "month", selected: true },
                    {
                        type: "agenda",
                        eventTimeTemplate: $("#event-time-template").html()
                    }
                ],
                dataSource: {
                    transport: {
                        read: {
                            url: "@Url.Action("Read", "Agenda")",
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            type: "POST"
                        },
                        update: {
                            url: "@Url.Action("Update", "Agenda")",
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            type: "POST"
                        },
                        parameterMap: function (options, operation) {
                            if (operation === "read") {
                                var scheduler = $("#scheduler").data("kendoScheduler");
                                var result = {
                                    start: scheduler.view().startDate(),
                                    end: scheduler.view().endDate()
                                }
                                return kendo.stringify(result);
                            }
                            return kendo.stringify(options);
                        }
                    },
                    serverFiltering: true,
                    schema: {
                        model: {
                            id: "taskID",
                            fields: {
                                taskID: { from: "TaskID", type: "number" },
                                title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                                titleClean: { from: "TitleClean", defaultValue: "Desconhecido" },
                                start: { type: "date", from: "Start" },
                                end: { type: "date", from: "End" },
                                startTimezone: { from: "StartTimezone" },
                                endTimezone: { from: "EndTimezone" },
                                description: { from: "Description" },
                                recurrenceId: { from: "RecurrenceID" },
                                recurrenceRule: { from: "RecurrenceRule" },
                                recurrenceException: { from: "RecurrenceException" },
                                ownerId: { from: "OwnerID", defaultValue: -1 },
                                isAllDay: { type: "boolean", from: "IsAllDay" },
                            }
                        }
                    },
                    error: function (e) {
                        alert("Erro."); // displays "Invalid query"
                    },
                },
                edit: function (e) {
                    $('a.k-button.k-scheduler-delete').remove();
                }
            });
        });

    <!-- Template -- >
    <script id="editor" type="text/x-kendo-template">
        <div class="container">
            <h3><a href="/Agenda/Details/#:data.titleClean#">Event #:data.title#</a></h3>
            <p>
                <label>Name: </label> #:data.description#
            </p>
           <p>
               <label>Begin: <input data-role="datetimepicker" name="start" /></label>
           </p>
           <p>
               <label>End: <input data-role="datetimepicker" name="end" /></label>
           </p>
        </div>
    </script>
  2. Answer
    Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 21 Jan 2014 Link to this post

    Hello Inelcis,

    We were able to observe the issue you have described and to address it. The fix will be included in the next internal build. Meanwhile I have updated your telerik points as a token of gratitude for bringing this to our attention.

    Regards,
    Rosen
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Inelcis
    Inelcis avatar
    6 posts
    Member since:
    Dec 2013

    Posted 27 Jan 2014 in reply to Rosen Link to this post

    Hello Rosen,

    Thanks for the reply and attention.

    Miguel Costa
    Inelcis
  5. Cory Seaman
    Cory Seaman avatar
    10 posts
    Member since:
    Jul 2006

    Posted 19 May 2015 in reply to Inelcis Link to this post

    I'm having the opposite problem - I can't get the Delete button to appear, even when I have "destroy: true" and "confirmation: true" set.  Is there something about using a custom template that causes problems with this, or does it have to do with having the delete-related methods properly defined?  Any guidance?
  6. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 21 May 2015 Link to this post

    Hello Cory,

    We have already provide you with an answer in the support thread you have open on the matter. Here is an expert from the answer of my colleague Georgi:

    The "delete" button is not displayed in this case, because you are adding SchedulerEvent instance without specifying its "id" field. In this case the event will be considered as new and thus the "Delete" button will not be rendered.

    If you have additional questions please continue the discussion in the support ticket.

    Regards,
    Rosen
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready