Hi all,
I am new to Kendo UI Calendar and I am facing what could be a standard behavior.
When the user clicks on an item on the calendar and a pop up opens to allow the item to be edited, the item becomes invisible in the calendar, once the item is edited, saved and the pop up closes, the item reappears on the calendar.
I would like the item to remain visible while being edited.
Is there a way around it?
Thanks
We have a C# MVC application that allows employees to enter hours spent per day on various activities for a given week (see the attached screenshot). However, one of the requirements of the application is that it update our Enterprise Resource Planning (ERP) system that we currently use. These updates must go into an intermediate table between this application and the ERP system. A stored procedure then picks up the data from this intermediate table and updates the ERP system appropriately. The trouble we are running into is getting the data accurately into the intermediate table. It needs the data put in as daily totals...
Date Hours
6/1/2016 9
6/2/2016 8
6/3/2016 8.5
Can I mark every row in the grid as changed, whether it has changed or not, so that all the rows get sent over to my controller? We'd like to do this to make the processing of the data that's going into the intermediate table easier. Or, is it possible to send over the "Daily Totals" row in the footer? These are fields that are set on the DataSource using the built in Aggregates method. Our DataSource is configured as follows...
.DataSource(dataSource => dataSource
.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(t => t.Sunday).Sum();
aggregates.Add(t => t.Monday).Sum();
aggregates.Add(t => t.Tuesday).Sum();
aggregates.Add(t => t.Wednesday).Sum();
aggregates.Add(t => t.Thursday).Sum();
aggregates.Add(t => t.Friday).Sum();
aggregates.Add(t => t.Saturday).Sum();
aggregates.Add(t => t.TotalHours).Sum();
}
)
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("timesheetGrid_error_handler"))
.Events(events => events.Change("timesheetGrid_change"))
.Events(events => events.RequestEnd("timesheetGrid_requestEnd"))
.Model(model => model.Id(t => t.rowId))
.Create(create => create.Action("Index_Create", "Home").Data("getCreateParams"))
.Destroy(destroy => destroy.Action("Index_Delete", "Home").Data("getUpdateParams"))
.Read(read => read.Action("Index_Read", "Home").Data("getReadParams"))
.Update(update => update.Action("Index_Update", "Home").Data("getUpdateParams"))
)
Hello Telerik,
I want use event features in Kendo UI calendar.
Example-
First Requirement - For attendance showing I want show on every date
P - Present
A - Absent
FH, SH - first half, second half
L - leave
Second Requirement - suppose I am going to click on P (present date) after click on that i want show the other details on same page or open popup or dialog for show IN Time and OUT Time details.
Please let me know about these two requirement how can I achieve the same using Kendo UI.
Thanks
Hello Telerik,
I was using in Date Range Selection, Single Selection and No Selection (Read Only) Telerik Calendar in native android app. But Now I am moving to Cordova based hybrid application so that I am using Kendo UI for Calendar in that. Please let me know How I will achieve this things with Kendo UI for Hybrid App(Android & iOS)
Please let me know asap
Thanks
Hello Telerik,
I want to apply date cell background colour according to working shift.
like -
General Shift - Green Background for all General shift date.
Holiday - Blue Background for all Holiday shift date.
Week Off - Red Background for all Week Off shift date.
Please guide me how can I achieve the same using Kendo UI calendar.
Thanks
I'm having an issue with CRUD calls being repeated. It only happens if I make two CRUD calls in a row, the second one pulls in the first one's data. For example, if I have a grid that has three records on it:
1. I hit delete on the first record which successfully deletes that record, no issues (note that I AM returning the ID of that record back to the grid)
2. I hit delete on the second record and it uses that model's data of the first record. Entity framework of course throws an error because it can no longer find that entity since it was deleted in the first call.
controller:
public ActionResult CostsDestroy(string models){ JavaScriptSerializer serializer = new JavaScriptSerializer(); CapitalLeaseCostModel model = new CapitalLeaseCostModel(); var CapitalLeaseCostModelArray = serializer.Deserialize<CapitalLeaseCostModel>(models); model = AccountingService.DeleteCapitalLeaseCost(CapitalLeaseCostModelArray); return PartialView(Json(model));}
View:
@model DataNet.Common.Models.CapitalLease.CapitalLeaseCostModel@*grid script*@<script> $(document).ready(function () { dataSource = new kendo.data.DataSource({ transport: { read: { url: "/CapitalLease/CostsRead", dataType: "json" }, update: { url: "/CapitalLease/CostsUpdate", dataType: "json", type: "POST", complete: function (e) { var grid = $('#capitalizedCostGrid').data("kendoGrid"); grid.dataSource.read(); } }, destroy: { url: "/CapitalLease/CostsDestroy", dataType: "json", type: "POST", complete: function (e) { e.success(data); var grid = $('#capitalizedCostGrid').data("kendoGrid"); grid.dataSource.read(); } }, create: { url: "/CapitalLease/CostsCreate", dataType: "json", type: "POST", complete: function (e) { e.success(data); var grid = $('#capitalizedCostGrid').data("kendoGrid"); grid.dataSource.read(); } }, parameterMap: function (options, operation) { if (operation !== "read" && options.models) { options.models[0].StartDate = kendo.toString(kendo.parseDate(options.models[0].StartDate, 'yyyy-MM-dd'), 'MM/dd/yyyy'); options.models[0].EndDate = kendo.toString(kendo.parseDate(options.models[0].EndDate, 'yyyy-MM-dd'), 'MM/dd/yyyy'); } if(operation === "create" && options.models){ options.models[0].EscalationTypeID = options.models[0].EscalationTypeID.ID; options.models[0].EscalationFrequencyID = options.models[0].EscalationFrequencyID.ID; } if (operation === "destroy" && options.models) { return { models: kendo.stringify(options.models[0]) }; } else { return { models: kendo.stringify(options.models), keyID: 106715 }; } } }, batch: true, pageSize: 20, schema: { model: { id: "ID", fields: { ID: { editable: true, nullable: false, defaultValue: -1 }, Reason: { validation: { required: true } }, CapitalLeaseEscalationType: { defaultValue: { ID: 1, EscalationType: "No Escalation" } }, CapitalLeaseEscalationFrequency: { defaultValue: { ID: 1, EscalationFrequency: "Monthly" } }, EscalationTypeID: { defaultValue: { ID: 1, EscalationType: "No Escalation" } }, EscalationFrequencyID: { defaultValue: { ID: 1, EscalationFrequency: "Monthly" } } } } } }); $("#capitalizedCostGrid").kendoGrid({ dataSource: dataSource, toolbar: ["create"], columns: [ { field: "ID", title: "ID", hidden: true }, { field: "Reason", title: "Reason" }, { field: "Amount", title: "Amount", format: "{0:c}" }, { field: "StartDate", title: "Start Date", type: "date", format: "{0:yyyy-MM-dd}", template: "#= kendo.toString(kendo.parseDate(data.StartDate, 'yyyy-MM-dd'), 'MM/dd/yyyy') #", editor: dateTimeEditor }, { field: "EndDate", title: "End Date", type: "date", format: "{0:yyyy-MM-dd}", template: "#= kendo.toString(kendo.parseDate(data.EndDate, 'yyyy-MM-dd'), 'MM/dd/yyyy') #", editor: dateTimeEditor }, { field: "EscalationTypeID", title: "Escalation Type", editor: escalationTypeDropDownEditor, template: "#=CapitalLeaseEscalationType.EscalationType#" }, { field: "EscalationFrequencyID", title: "Escalation Frequency", editor: frequencyTypeDropDownEditor, template: "#=CapitalLeaseEscalationFrequency.EscalationFrequency#" }, { field: "EscalationPercentage", title: "Escalation Percent", template: "<div> #= kendo.toString(data.EscalationPercentage / 100, 'p0') #</div>" }, { field: "EscalationMonetary", title: "Monetary Escalation", format: "{0:c}" }, { command: ["edit", "destroy"], title: "Edit", width: "200px" } ], editable: "popup", edit: function (e) { e.container.find(".k-edit-label:first").hide(); e.container.find(".k-edit-field:first").hide(); }, height: 200, autoSync: true }) @*Attaches to Escalation type drop down list*@ function escalationTypeDropDownEditor(container, options) { $('<input required data-text-field="EscalationType" data-value-field="ID" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ autoBind: true, dataSource: { type: "json", transport: { read: "/CapitalLease/CostsEscalationTypeRead" } } }); } @*Attaches to Escalation Frequency drop down list*@ function frequencyTypeDropDownEditor(container, options) { $('<input required data-text-field="EscalationFrequency" data-value-field="ID" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ autoBind: true, dataSource: { type: "json", transport: { read: "/CapitalLease/CostsEscalationFrequencyRead" } } }); } @*Formats the date-picker in-grid*@ function dateTimeEditor(container, options) { $('<input data-text-field="' + options.field + '" data-value-field="' + options.field + '" data-bind="value:' + options.field + '" data-format="' + options.format + '"/>') .appendTo(container) .kendoDatePicker({}); } });</script><style> .k-grid .k-grid-header .k-header .k-link { height: auto; } .k-grid .k-grid-header .k-header { white-space: normal; }</style>@*Rent Information*@<p class="title">Section Two - Lease Costs to Capitalize</p><div style="padding:15px;"> <div id="costsRowOne"> <div id="capitalizedCostGrid" class="inline-control"></div> </div></div>
What am i missing here.