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

Editable.destroy = false not work in popup details

4 Answers 190 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Inelcis
Top achievements
Rank 1
Inelcis asked on 20 Jan 2014, 03:04 PM
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>

4 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 21 Jan 2014, 07:59 AM
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!
0
Inelcis
Top achievements
Rank 1
answered on 27 Jan 2014, 11:15 AM
Hello Rosen,

Thanks for the reply and attention.

Miguel Costa
Inelcis
0
Cory Seaman
Top achievements
Rank 1
answered on 19 May 2015, 12:47 PM
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?
0
Rosen
Telerik team
answered on 21 May 2015, 06:31 AM

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!
 
Tags
Scheduler
Asked by
Inelcis
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Inelcis
Top achievements
Rank 1
Cory Seaman
Top achievements
Rank 1
Share this question
or