I'm trying to get Gantt working. I've configured it to use server to perform read, create and update. It loads events correctly and displays them on screen. I can update them just fine.
However when I try to create new event, I get CreateEvent method called, I create event on server side, fill in all data, initialize Id field and send it back to server, just as required in documentation and done in demo code. When I try to update this newly created event I get new Create event being called, instead of update.
I assume that this is because UI does not store Id I've returned from server correctly. Even though I return element with Id = 9, I can see in kedo dataSource.data() that one of the elements have Id = 0.
What am I doing wrong?
public ActionResult CreateEvent([DataSourceRequest] DataSourceRequest request, EventVm @event) { var tm = new ProjectTimelineVm(); tm.Events.Add(@event); @event.Id = tm.Events.Max(e => e.Id) + 1; @event.Start = DateTime.Parse(Request.Form["Start"], System.Globalization.CultureInfo.InvariantCulture); @event.End = DateTime.Parse(Request.Form["End"], System.Globalization.CultureInfo.InvariantCulture); @event.OrderId = @event.Id; @event.Expanded = false; @event.Summary = false; return Json(new[] { @event }.ToDataSourceResult(request, ModelState)); }
and client side configuration (note that EventVm has Id property and Id property is expected by model configuration, after page reload newly added event will work fine):
var gantt;$(function () { gantt = $("#timelineGantt").kendoGantt({ columns: [ { field: "Id", title: "ID", sortable: true }, { field: "title", title: "Title", sortable: true }, { field: "start", title: "Start", format: "{0: yyyy-MM-dd hh:mm:ss}", sortable: true }, { field: "end", title: "End", format: "{0: yyyy-MM-dd hh:mm:ss}", sortable: true }], snap: true, height: 500, showWorkDays: false, showWorkHours: false, views: [ { type: "day" }, { type: "week", selected: true }, { type: "month" }], dataSource: { type: (function () { if (kendo.data.transports['aspnetmvc-ajax']) { return 'aspnetmvc-ajax'; } else { throw new Error('The kendo.aspnetmvc.min.js script is not included.'); } })(), transport: { read: { url: "/Record/Project/ReadEvent" }, prefix: "", update: { url: "/Record/Project/UpdateEvent" }, create: { url: "/Record/Project/CreateEvent" } }, schema: { data: "Data", total: "Total", errors: "Errors", model: { id: "Id", fields: { Id: { type: "number" }, parentId: { from: "ParentId", type: "number", defaultValue: null }, orderId: { from: "OrderId", type: "number" }, percentComplete: { from: "PercentComplete", type: "number" }, start: { from: "Start", type: "date", defaultValue: new Date(2016, 3, 25, 14, 42, 36, 959) }, end: { from: "End", type: "date", defaultValue: new Date(2016, 3, 25, 14, 42, 36, 959) }, title: { from: "Title", type: "string" }, summary: { from: "Summary", type: "boolean", defaultValue: false }, expanded: { from: "Expanded", type: "boolean", defaultValue: false } } } }, }, dependencies: { type: (function () { if (kendo.data.transports['aspnetmvc-ajax']) { return 'aspnetmvc-ajax'; } else { throw new Error('The kendo.aspnetmvc.min.js script is not included.'); } })(), transport: { read: { url: "" }, prefix: "" }, schema: { data: "Data", "total": "Total", errors: "Errors", model: { fields: { Type: { type: "number" }, DependencyID: { type: "number" }, PredecessorID: { type: "number" }, SuccessorID: { type: "number" } } } }, data: { Data: [], Total: 0, AggregateResults: null } } }).data("kendoGantt");});Hi,
I was trying to create a angular stock chart with multiple series but no data/series displayed on chart. Here is the html and java script code.
Am I missing something in chart options ? Please help.
Html:
<div kendo-stock-chart k-options="chartOptions" style="height:400px; width:870px;" ></div>
$scope.chartOptions = {
dateField: "DateTime",
valueAxis: [{
labels: {
format: {}
}
}],
seriesDefaults: {
type: "line",
style: "smooth"
},
series: [{
type: "line",
style: "smooth",
field: "KPIVALUE",
name: "Jan 11 2014 12:00AM",
tooltip: {
visible: "true",
template: "#=DateTime#-#=KPIVALUE#"
},
data: [{
DateTime: "2014-01-11T00:00:00.000Z",
DateTimeTicks: "1391212800000",
KPINAME: "percent11",
KPIVALUE: 99.904454,
SeriesName: "Jan 11 2014 12:00AM"
}, {
DateTime: "2014-01-11T00:15:00.000Z",
DateTimeTicks: "1391213700000",
KPINAME: "percent11",
KPIVALUE: 99.900868,
SeriesName: "Jan 11 2014 12:00AM"
}, {
DateTime: "2014-01-11T00:30:00.000Z",
DateTimeTicks: "1391214600000",
KPINAME: "percent11",
KPIVALUE: 99.861033,
SeriesName: "Jan 11 2014 12:00AM"
}, {
DateTime: "2014-01-11T00:45:00.000Z",
DateTimeTicks: "1391215500000",
KPINAME: "percent11",
KPIVALUE: 99.906269,
SeriesName: "Jan 11 2014 12:00AM"
}, {
DateTime: "2014-01-11T01:00:00.000Z",
DateTimeTicks: "1391216400000",
KPINAME: "percent11",
KPIVALUE: 99.91746,
SeriesName: "Jan 11 2014 12:00AM"
}]
}]
}
Hi,
I have a grid with scrollable: { virtual: true }, pagesize: 25 setup with local data. I select a row and scroll away so paging happens, when I scroll back, and selection is lost. I saw other threads with suggested solution to do hacks around onChange and onDataBound event: http://jsbin.com/himuboxi/2/edit?html,output
My problem is, my grid is bound to local data, thus the DataBound event is fired when I scroll around. What other event could I depend on?
Best,
Ama
Hi all,
I'm trying to save the current occurrence of the recurring event. But it cannot be saved, and I see the following error message in the console:
kendo.all.js:82119 Uncaught TypeError: Cannot read property 'isRecurrenceHead' of undefined
Could you please help me resolving it?
Kind Regards,
shapeMouseEnter and Leave events are sometimes called, but not always. To repeat this bug, just drag mouse over squares. Sometimes it is painted and sometime it is not.
Can somebody please tell how to disable already applied dates.
For example, if i have selected range by entering start date and end date for a particular user then for that user next start date should show from previous end date
that is he shouldn't be able to select previous range.
For instance, kendo generates the following url for odata
http://gmovpwbwebdev01:8001/odata/PSellerPartnerMPNLocation?%24format=json&%24expand=PSeller%2C+Geography&%24top=20&%24orderby=PSEllerName&%24filter=((Geography%2FSubsidiaryDistrictId+eq+11182+or+Geography%2FSubsidiaryDistrictId+eq+11179)+and+(Geography%2FSubsidiaryId+eq+161+or+Geography%2FSubsidiaryId+eq+49)+and+Geography%2FAreaId+eq+5)&%24count=true
How do I retrieve the url that is build on the client. I need to send the odata filter to the server for different processing and I don't want to build the string myself if kendo is already doing that.
Hi,
We've run into a problem with using the autocomplete inside a grid. The issue, as stated in the title, is that the popup is positioned in the upper left hand corner, rather than being positioned underneath the grid cell.
Here is a dojo which duplicates the problem: http://dojo.telerik.com/@villagemedia/ujize