Hi Telerik,
I was trying add TreeList in Grid with ClientDetailTemplate but It's not running, I afraid Grid is not support ClientDetailTemplate with TreeList,
Can you please give me a demo about this issue?
Thanks alot
Anyone know why when I remove an item from my datasource it removes it from my database, but not my Mobile List View? Below is basically what I'm doing:
model = dataSource.getByUid($(e.touch.target).attr("data-uid"));
dataSource.remove(model);
dataSource.sync();
I got this from the mobilelistview sample app and it works correctly, just not with my modified mobile list view. Could it be because of a filter I have or my type of model or something? Here is the Mobile list view control section:
Html.Kendo().MobileListView<eAgentWeb.Models.CallLogModel>()
.Name("MainListView")
.TemplateId("itemTemplate")
.PullToRefresh(true)
.EndlessScroll(true)
.DataSource(dataSource => dataSource
.Sort(sort => sort.Add("DateModified").Descending())
.Filter(filters => { filters.Add(calllog => calllog.IsArchive).IsEqualTo(false); })
.Read(read => read.Action("GetCallLogData", "CallLog"))
.Destroy("callLog_Destroy", "CallLog")
.PageSize(30)
.Events(events => events.RequestEnd("listViewRequestEnd"))
.Model(model => model.Id(c => c.CallLogID))
)
)
)
Any help would be greatly appreciated!
I'm am about to inherit a project developed with Kendo UI for ASP.NET MVC version 2015.1.408.
The older versions that I can download are:
2015.3.1111
2015.3.930
2015.2.624
I there any way that I can get to version 2015.1.408?
A similar question in the WinForms forum (http://www.telerik.com/forums/unable-to-get-an-older-version-of-the-controls) mentions backdating the license.
I have a column chart, defined in MVC as below:-
@(Html.Kendo().Chart<Dashboard.Models.BarChartDataItem>(Model) .Name((string)ViewBag.ChartName) .Title((string)ViewBag.ChartTitle) .Theme("bootstrap") .Legend(legend => legend .Position(ChartLegendPosition.Top) .Visible(false) ) .Series(series => { series.Column(model => model.BarValue).Name("Actual").Tooltip(t=>t.Visible(true).Template("<div><p>Category:#=dataItem.AxisDescription#</p><p>Contribution: £#=dataItem.DisplayBarValue#</p></div>")); }) .ChartArea(area => area .Height(350) .Background("transparent") ) .ValueAxis(axis => axis.Numeric() .Labels(labels => labels.Format("{0:N2}")) .Title((string)ViewBag.Yaxis) .AxisCrossingValue(0, int.MinValue) .Line(line => line.Visible(false)) ) .CategoryAxis(axis => axis .Labels(false)) .CategoryAxis(axis => axis .Categories(model => model.AxisValue) .Labels(labels => labels.Rotation(-45).Padding(5)) .MajorGridLines(lines => lines.Visible(false)) .Title((string)ViewBag.Xaxis) ) .Events(e=>e.SeriesClick("seriesClick")) .Tooltip(tooltip => tooltip .Visible(true) .Format("{0:N2}") ))I then use the SeriesClick event, to implement a data drill-down, which refreshes with the chart with new data (based on the level of drill-down and the value of the clicked column), based on an Ajax call, which gets new JSON data.
function PODDrillDown(pod,conscode,specialtycode,directorateCode, period) { var directorate = directorateCode; selectedDirectorate = directorateCode; selectedspec = specialtycode; selectedcons = conscode; selectedPOD = pod; var chartData; $.ajax({ type: "POST", async: true, contentType: "application/json;charset=utf-8", url: "@Url.Content("~/ChartMaker/GetHRGChapterBarChartData")", data: '{"id":2,"periodID":' + period + ',"DirectorateCode":"' + directorate + '","SpecCode":"' + specialtycode + '","ConsCode":"' + conscode + '","POD":"' + pod + '" }', dataType: "json", success: function (data) { if (data.Success == true) { chartData = data.chartData; var dataSource = new kendo.data.DataSource({ data: chartData }); var chart = $("#Chart_ID_1").data("kendoChart"); chart.dataSource = dataSource; chart.options.title.text = data.ChartTitle; chart.options.valueAxis.title.text = data.YAxisTitle; chart.options.categoryAxis[1].title.text = data.XAxisTitle; chart.dataSource.read(); chart.refresh(); } else { alert(data.Error); } }, error: function () { alert("An error has occurred"); } }); }This works well, however with one particular drill-down , the chart doesn't render properly. The series labels are shown, the value axis seems scaled correctly, but the columns aren't rendered (I've attached an image of the chart). I can't see any issues with the data, all the data calls return data in the same structure, and no errors are thrown.
The Ajax call returns the data below :-
{"ChartTitle":"Performance for Consultant 4835","XAxisTitle":"Point of Delivery","YAxisTitle":"Contribution (£)","Success":true,"Message":"Data retrieved","Error":null,"chartData":[{"BarValue":-2476080.767381317,"AxisValue":"Other","AxisCode":"OTHER","ExtraValue":4,"AxisDescription":"Other","DisplayBarValue":"-2,476,081"},{"BarValue":-2476080.7673813165,"AxisValue":"Block","AxisCode":"BLOCK","ExtraValue":4,"AxisDescription":"Block","DisplayBarValue":"-2,476,081"}]}Is this a bug in the chart, or is it something in the code?
Thanks
Hello,
I have a Razor build-ed grid which the datasource is WebAPI. The model contains a decimal field.
In Dutch (nl-NL) the separated character for decimal is comma instead of dot.
When setting in JS the Kendo.culture to "nl-NL", and the input contains a comma as decimal separated character, the created JSON model from Kendo Grid to the WebAPI contains also the comma instead of dot. At server-side the input will bbe set without decimal.
Example: 34,45 is in the JSON and gives 3445.
If the culture is removed, the JSON contains the dot and all works fine.
Question is, can I force the generated JSON model to handle input always as default culture (dot as decimal separated)?
This is part of my custom editor:
<div data-container-for="studentID" class="k-edit-field">
@(Html.Kendo().ComboBoxFor(model => model.StudentID)
.HtmlAttributes(new { data_bind = "value:StudentID" })
.DataTextField("FullName")
.DataValueField("StudentId")
.Filter(FilterType.Contains)
.AutoBind(false)
.Placeholder("Start typing student's name...")
.Text(Model.StudentID != null ? Model.Title : "")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetStudents", "Student").Data("filterStudents");
})
.ServerFiltering(true);
})
.Events(e =>
{
e.Select("onStudentSelected");
})
)
</div>
<div data-container-for="title" class="k-edit-field">
@(Html.HiddenFor(model => model.Title, new { id = "TitleId", data_bind = "value:title" }))
</div>
I am trying to set the title with the text from the combobox:
function onStudentSelected(e) {
var dataItem = this.dataItem(e.item.index());
$("#TitleId").val(dataItem.FullName);
};
Alert on $("#TitleId").val() shows that it is set. But when I save the template the value is not passed to the server.
I have also made Title just a standard textboxfor so that I can see that the value is set.
Why is this not persisting to the model?
Also, this is my schduler:
@(Html.Kendo().Scheduler<Excent.Apps.Web.Solo.Models.MeetingViewModel>()
.Name("scheduler")
.Date(DateTime.Today)
.StartTime(DateTime.Today.AddHours(8))
.EndTime(DateTime.Today.AddHours(23).AddMinutes(59))
.Height(600)
.Views(views =>
{
views.DayView(dw => dw.DateHeaderTemplate("#=kendo.toString(date, 'd')#")).ShowWorkHours(true);
views.WeekView(weekView => weekView.DateHeaderTemplate("#=kendo.toString(date, 'MM/dd')#").SelectedDateFormat("{0:MM/dd/yyyy} to {1:MM/dd/yyyy}")).ShowWorkHours(true).Selected(true);
views.MonthView();
views.AgendaView(aw => aw.Title("Session").SelectedDateFormat("{0:MM/dd/yyyy} to {1:MM/dd/yyyy}"));
})
.Editable(editable =>
{
editable.TemplateName("CustomEditorTemplate");
})
.Timezone("Etc/UTC")
.EventTemplateId("event-template")
.DataSource(d => d
.Model(m =>
{
m.Id(f => f.MeetingID);
m.Field(f => f.Start);
m.Field(f => f.End);
m.Field(f => f.IsAllDay);
m.Field(f => f.Title);
m.Field(f => f.RecurrenceRule);
m.Field(f => f.Description);
m.Field(f => f.StudentID);
m.Field(f => f.ProcedureCode);
m.Field(f => f.Color);
m.RecurrenceId(f => f.RecurrenceID);
})
.Events(e => e.Error("error_handler"))
.Read("Meetings_Read", "ProviderHome")
.Create("Meetings_Create", "ProviderHome")
.Destroy("Meetings_Destroy", "ProviderHome")
.Update("Meetings_Update", "ProviderHome")
)
)
Is there a way to disable drag and drop for tasks in the scheduler?
I want my users only to be able to edit tasks through the edit form.
/Jonas
I have a very simple listview that I cannot get to show any data.
View:
@(Html.Kendo().ListView<PortalContext.Root>()
.Name("leafView")
.TagName("div")
.ClientTemplateId("leafTemplate")
.DataSource(dataSource => {
dataSource.Model(model => { model.Id(p => p.RootId);
model.Field<string>(f => f.ShortName);
});
dataSource.Read(read => read.Action("Leafs", "Home").Data("branchLevel"));
})
)
<script type="text/x-kendo-tmpl" id="leafTemplate">
<div style="height:100px">
#: ShortName #
</div>
</script>
I have a treeview that refreshes the data onSelect
function onSelect(e) {
if (treeview.dataItem(e.node).IsBranch) {
branchId = treeview.dataItem(e.node).id;
$("#leafView").data("kendoListView").dataSource.read();
}
}
function branchLevel() {
return {
branchId: branchId
};
}
I have simplified a few things but my controller looks like this and is basically returning a list of objects.
public ActionResult Leafs([DataSourceRequest]DataSourceRequest request, int? branchId) {
return Json(ViewModel.Roots.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
}
Any ideas why this may not be working?
Bill
I use the Ajax Editing to manage the record in my grid .
I would like call the controller before edit the selected record to check if the record is not lock.
I would like have this process :
- Click on "Edit" buttom on grid,
- Call the action controller to check the lock,
-> If record lock, Abort Edit record,
-> If record is not lock, Edit record.
Do you know of a great way to make this process ?
Thanks
I set up a simple grid like this using the Razor syntax:
@(Html.Kendo().Grid<GridCustomPopupTemplate.Models.Person>().Name("persons") .DataSource(dataSource => dataSource .Ajax() .Model(model => model.Id(m => m.PersonID)) .Read(read => read.Action("GetPersons", "Home")) .Update(up => up.Action("UpdatePerson", "Home")) ) .Columns(columns => { columns.Bound(c => c.PersonID).Width(200); columns.Bound(c => c.Name); columns.Command(cmd => { cmd.Edit(); }); }) .Pageable() .Sortable() .Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("Person")))