I have a scheduler which allows to add attendees
@(Html.Kendo().Scheduler<AGAT.TSSM.Web.Models.Schedule.ScheduleViewModel>() .Name("scheduler") .Date(DateTime.Today) .StartTime(DateTime.Today.AddHours(7)) .EndTime(DateTime.Today.AddHours(21)) .WorkDayStart(8, 0, 0) .WorkDayEnd(21, 0, 0) .WorkWeekStart(1) .WorkWeekEnd(0) .Timezone("Etc/UTC") .EventTemplateId("customEventTemplate") .AllDayEventTemplateId("customAllDayTemplate") .Views(views => { views.DayView(d => d.DateHeaderTemplate("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd dd/M')#</span>")); views.WeekView(weekView => weekView.Selected(true).DateHeaderTemplate("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd dd/M')#</span>")); views.MonthView(); views.AgendaView(); }) .Editable(editable => { editable.TemplateName("_ScheduleWindowTemplate"); }) .DataSource(d => d .Model(m => { m.Id(f => f.Id); }) .Events(e => e.Error("error_handler")) .Read("Read", "Schedule") .Create("Create", "Schedule") .Update("Update", "Schedule") .Destroy("Delete","Schedule") ))A pop up window comes from a template
@using AGAT.TSSM.Logic.Domain.Model.Schedule;@using AGAT.TSSM.Web.Models.User;@model AGAT.TSSM.Web.Models.Schedule.ScheduleViewModel@{ //required in order to render validation attributes ViewContext.FormContext = new FormContext();}@functions{ public Dictionary<string, object> generateDatePickerAttributes( string elementId, string fieldName, string dataBindAttribute, Dictionary<string, object> additionalAttributes = null) { Dictionary<string, object> datePickerAttributes = additionalAttributes != null ? new Dictionary<string, object>(additionalAttributes) : new Dictionary<string, object>(); datePickerAttributes["id"] = elementId; datePickerAttributes["name"] = fieldName; datePickerAttributes["data-bind"] = dataBindAttribute; datePickerAttributes["required"] = "required"; datePickerAttributes["style"] = "z-index: inherit;"; return datePickerAttributes; }}<div class="k-edit-label"> @(Html.LabelFor(model => model.Title))</div><div data-container-for="title" class="k-edit-field"> @(Html.TextBoxFor(model => model.Title, new { @class = "k-textbox", data_bind = "value:title" }))</div><div class="k-edit-label"> @(Html.LabelFor(model => model.Location))</div><div data-container-for="title" class="k-edit-field"> @(Html.TextBoxFor(model => model.Location, new { @class = "k-textbox", data_bind = "value:Location" }))</div><div class="k-edit-label"> @(Html.LabelFor(model => model.IsAllDay))</div><div data-container-for="isAllDay" class="k-edit-field"> <input data-bind="checked: isAllDay" data-val="true" id="IsAllDay" name="IsAllDay" type="checkbox" /></div><div class="k-edit-label"> @(Html.LabelFor(model => model.Start))</div><div data-container-for="start" class="k-edit-field"> @(Html.Kendo().DateTimePickerFor(model => model.Start) .HtmlAttributes(generateDatePickerAttributes("startDateTime", "start", "value:start,invisible:isAllDay"))) @(Html.Kendo().DatePickerFor(model => model.Start) .HtmlAttributes(generateDatePickerAttributes("startDate", "start", "value:start,visible:isAllDay"))) <span data-bind="text: startTimezone"></span> <span data-for="start" class="k-invalid-msg"></span></div><div class="k-edit-label"> @(Html.LabelFor(model => model.End))</div><div data-container-for="end" class="k-edit-field"> @(Html.Kendo().DateTimePickerFor(model => model.End) .HtmlAttributes(generateDatePickerAttributes( "endDateTime", "end", "value:end,invisible:isAllDay", new Dictionary<string, object>() { { "data-dateCompare-msg", "Окончание должно быть позднее начала" } }))) @(Html.Kendo().DatePickerFor(model => model.End) .HtmlAttributes(generateDatePickerAttributes( "endDate", "end", "value:end,visible:isAllDay", new Dictionary<string, object>() { { "data-dateCompare-msg", "Окончание должно быть позднее начала" } }))) <span data-bind="text: endTimezone"></span> <span data-for="end" class="k-invalid-msg"></span></div><div class="k-edit-label"> @(Html.LabelFor(model => model.RecurrenceRule))</div><div data-container-for="recurrenceRule" class="k-edit-field"> @(Html.Kendo().RecurrenceEditorFor(model => model.RecurrenceRule) .HtmlAttributes(new { data_bind = "value:recurrenceRule" }))</div><div class="k-edit-label"> @(Html.LabelFor(model => model.ScheduleType))</div><div data-container-for="ScheduleType" class="k-edit-field"> @* @Html.DropDownListFor(m => m.ScheduleType, Model.ScheduleTypeList)*@ @(Html.Kendo().DropDownListFor(model => model.ScheduleType) .HtmlAttributes(new { data_bind = "value:ScheduleType", style = "width: 200px" }) .DataTextField("Text") .DataValueField("Value") .OptionLabel("None") .ValuePrimitive(true) .Template("<span class='k-scheduler-mark' style='background-color:\\#= data.Color?Color:'' \\#'></span>\\#=Text\\#") .Events(e => e.Change("scheduleTypeChange")) .BindTo(new[] { new { Text = "Обычное событие", Value = ScheduleType.GeneralSchedule, Color = "\\#6eb3fa" }, new { Text = "Работа над заявкой", Value = ScheduleType.WorkOnRequest, Color = "\\#D9534F" }, new { Text = "Работа над задачей", Value = ScheduleType.WorkOnTask, Color = "\\#5CB85C" }, new { Text = "Работа над проектом", Value = ScheduleType.WorkOnProject, Color = "\\#F0AD4E" }, new { Text = "Собрание", Value = ScheduleType.GroupMeeting, Color = "\\#f58a8a" } }).ToClientTemplate() )</div><div id="item-reference" style="display: none;"> <div class="k-edit-label"> @(Html.LabelFor(model => model.ItemReference, new { id = "ref-label" })) </div> <div data-container-for="title" class="k-edit-field"> @(Html.TextBoxFor(model => model.ItemReference, new { @class = "k-textbox", data_bind = "value:ItemReference" })) </div></div><div id="item-invitees"> <div class="k-edit-label"> @(Html.LabelFor(model => model.ScheduleInvitees, new { id = "ref-label" })) </div> <div data-container-for="title" class="k-edit-field"> @(Html.Kendo().MultiSelectFor(m => m.ScheduleInvitees) .Name("ScheduleInvitees") .HtmlAttributes(new { data_bind = "value:ScheduleInvitees" }) .DataTextField("Name") .DataValueField("Id") .TagTemplateId("tagTemplate") .ItemTemplateId("itemTemplate") .Filter("contains") .AutoBind(true) .ValuePrimitive(true) .DataSource(source => { source.Read(read => { read.Action("GetInvitees", "Base"); }) .ServerFiltering(true); }) .Value(Model.InvitedUsers) ) </div></div>My problem is that the multiselect sets new attendees but not reading them when I want to edit it
.DataSource(source => { source.Read(read => { read.Action("GetInvitees", "Base"); }) .ServerFiltering(true); }) .Value(Model.InvitedUsers)InvitesUsers come from my model and it is a SelectList and I set it like this:
InvitedUsers = users.ToSelectList(x => new ExtSelectItem
{
Selected = true,
Text = x.Name,
Value = x.Id.ToString()
}
I am trying to get my actionlinks to redner into one column. Currently I have them all laid out in individual columns, but can't figure out how to merge them into one.
.Columns(columns => { columns.Bound(obcs => obcs.ProfileName).Title(xxx.Controllers.FieldTranslation.GetLabel("ProfileName", @xxx.DNetSynch.GlobalVariables.LanguageID)); columns.Bound(obcs => obcs.EEFinalize).ClientTemplate("#= EEFinalize ? 'Yes' : 'No' #").Title(xxx.Controllers.FieldTranslation.GetLabel("EEFinalize", @xxx.DNetSynch.GlobalVariables.LanguageID)); //columns.Bound(obcs => obcs.CCFinalize).ClientTemplate("#= CCFinalize ? 'Yes' : 'No' #"); columns.Bound(obcs => obcs.Completed).ClientTemplate("#= Completed ? 'Yes' : 'No' #").Title(xxx.Controllers.FieldTranslation.GetLabel("Completed", @xxx.DNetSynch.GlobalVariables.LanguageID)); columns.Template(@<text> @Html.ActionLink(@item.ProfileID.ToString(), "Index", "OBProfileTasks", new { @item.ProfileID }) </text>) .ClientTemplate("<a class='k-button' href='./OBProfileTasks/Index/#= ProfileID#'>Tasks</a>") .Title(xxx.Controllers.FieldTranslation.GetLabel("Tasks", @xxx.DNetSynch.GlobalVariables.LanguageID)); columns.Template(@<text> @Html.ActionLink(@item.ProfileID.ToString(), "Index", "OBProfileTasks", new { @item.ProfileID }) </text>) .ClientTemplate("<a href='OBProfileTasks/Index/#= ProfileID#'><i style='color:black;' class='fa fa-plus fa-lg' title='Assign To Client'></a>") .Title(xxx.Controllers.FieldTranslation.GetLabel("AssignToClient", @xxx.DNetSynch.GlobalVariables.LanguageID)); columns.Template(@<text> @Html.ActionLink(@item.ProfileID.ToString(), "Replica", "OBProfile", new { @item.ProfileID }) </text>) .ClientTemplate("<a href='OBProfile/Replica/#= ProfileID#'><i style='color:green;' class='fa fa-clipboard fa-lg' title='Replicate'></a>") .Title(xxx.Controllers.FieldTranslation.GetLabel("Replicate", @xxx.DNetSynch.GlobalVariables.LanguageID)); columns.Template(@<text> @Html.ActionLink(@item.ProfileID.ToString(), "Delete", "OBProfile", new { @item.ProfileID }) </text>) .ClientTemplate("<a href='OBProfile/Delete/#= ProfileID#' onclick='return confirm_delete()' title='Delete'><i style='color:red;' class='fa fa-times fa-lg'></i></a> ") .Title(xxx.Controllers.FieldTranslation.GetLabel("Delete", @xxx.DNetSynch.GlobalVariables.LanguageID)); columns.Command(command => { command.Edit(); // command.Destroy().HtmlAttributes(new { @class = "onboard-delete " }); }).Title(xxx.Controllers.FieldTranslation.GetLabel("Controls", @xxx.DNetSynch.GlobalVariables.LanguageID)); })
I'm using a panelbar to display a list of chapters. Within each panel is a list of tasks within that chapter. Think of it like a list:
When the page is loaded, I want to expand the panel w/ the first incomplete task. I know which chapter contains this task (by index, not by ID), and want to have it be expanded when I initialize the panelbar.
Current accordion JS:
function initTasksAccordion() { $("#task_accordion").kendoPanelBar({ expandMode: "multiple" });}And some sample HTML:
<ul id="task_accordion"> # for (var c = 0; c < data.Chapters.length; c++) { # <li>#= data.Chapters[c].Name # # for (var t = 0; t < data.Chapters[c].Tasks.length; t++) { # <div> <h3 class="item-title">#= data.Chapters[c].Tasks[t].Name #</h3> <div class="clear"></div> </div> # } # </li> # } # </ul>So if my first incomplete task is Task 4, I would know that it's the second (or first, if you use 0-based indexing) panel I want to have expanded when the panelbar is created. While I do have multiple selection enabled, for the initial load, only the one panel (with the incomplete task) should be expanded.
Hi
I have the following ClientTemplate column:
columns.Bound(a => a.Quantity).Title("Anzahl").Width(55).ClientTemplate("<input class='text' value='#=Quantity#' id='Quantity' />").Format("{0:n0}");Values displayed or entered here are not exported to PDF.
How can I make this work?
Thanks
Hi
I want to replace every tooltip on my site with the kendo one, I also want in some places to use the 'title' of the div, or to get data dynamically using ajax. To accomplish this I have a tooltip like the below
$('body').kendoTooltip({
filter: "img[data-tooltip-data], div[data-tooltip-data], [title][title!='']",
and content gets the content depending on the target type. I've put the tooltip on body as I want it across everything on the site. I've used a single tooltip rather than multiple tooltips, this is based on advice I've seen in the forums.
I'm getting the problem you can see in the dojo below.
http://dojo.telerik.com/AmEYa
The tooltip never disappears. I'm assume I'm doing something wrong here but I'm not sure how I'm meant to do this
thanks
Anthony
Hi,
Is there any way to retrieve a view column index from the model ( myGrid.columns ) ?
I'm looking for a method like viewIndex() on a column object such like the following code ( or viewIndex(column) ) :
for (var i = 0; i < myGrid.columns.length; i++) { var column = myGrid.columns[i]; console.log('Model column index : ' + i + ' - View column index : ' + column.viewIndex());}Have you any idea ?
Thanks for your help.
Hi,
A newbee to kendo and js:). I am trying to use kendo scheduler in my project and having issue with Create / update operations. Create / Update opertions works and DB is updated but kendo UI dialog stays and gets following error "Uncaught TypeError: Cannot read property 'getTimezoneOffset' of null". Refreshing browser display newly added /updated event. Also in destroy method I nned to add event id to path like /schedules/id, how to add this, in parameterMap we gets like options.models[0].id but not in destroy method.
Any quick help is appreciated. Posting my code:
'use strict';