Hi,
I have a scheduler which by default loads with month view showing (as per requirements) with the current date showing by default. However, if a date is passed in via the querystring, I want it to load as day view instead and navigate to that date. I have figured out how to change the selected date, but I can't get it so change the initial view based on this variable - how can I achieve this? I've added my code below.
Thanks, Mark
=== DEFINITION OF SCHEDULER ===
@{
//Get the initial scheduler date from the URL
DateTime schedulerInitDate = DateTime.Today;
if (Request.QueryString["date"] != null && Request.QueryString["date"].Length == 8)
{
string strQueryStringDate = Request.QueryString["date"];
string dayPart = strQueryStringDate.Substring(0, 2);
string monthPart = strQueryStringDate.Substring(2, 2);
string yearPart = strQueryStringDate.Substring(4, 4);
schedulerInitDate = new DateTime(int.Parse(yearPart), int.Parse(monthPart), int.Parse(dayPart), 0, 0, 0);
}
}
@( Html.Kendo().Scheduler<DiaryItemViewModel>()
.Name("diary")
.Editable(false)
.Date(schedulerInitDate) // sets the initial date for when it loads as today - in month view this takes you to current month, week view to current week etc.
.StartTime(new DateTime(2015, 6, 1, 7, 00, 00)) // sets the start time in day view - 1/6/2015 is arbitrary here, could be any date!
.EndTime(new DateTime(2015, 6, 1, 19, 00, 00)) // sets the end time in day view - 1/6/2015 is arbitrary here, could be any date!
.EventTemplate("<div title='#= title #'>" +
"<div class='k-event-template' style='width:100%; margin-bottom:6px;'><span style='font-weight: bold;'>#= title #</span></div>" +
"#if(Confirmed) {#<div class='k-event-template' style='width:100%; margin-bottom:6px;'><img src='/Content/images/icons/calendar.png' /> Appointment Confirmed</div>#" +
"} else {#<div class='k-event-template' style='width:100%; margin-bottom:6px;'><img src='/Content/images/icons/calendar-grey.png' /> Appointment Unconfirmed</div>#}#" +
"<div class='k-event-template' style='width:100%; margin-bottom:6px;'>#= Reference #</div>" +
"<div class='k-event-template' style='width:100%; margin-bottom:6px;'><span style='font-weight: bold;'>Visit By:</span> #= VisitBy #</div>" +
"</div>")
.Views(views =>
{
views.MonthView();
views.WeekView();
views.DayView();
})
.Timezone("Etc/UTC")
.DataSource(d => d
.ServerOperation(true)
.Read(read => read.Action("GetAppointments", "Diary").Data("getAdditionalData"))
)
.Resources(resource =>
{
resource.Add(m => m.Title)
.Title("Type")
.DataTextField("Title")
.BindTo(new[] {
new { text = "General", value = "General", color = "#ffffff" } ,
new { text = "Legionella", value = "Legionella", color = "#000000" } ,
new { text = "Survey", value = "Survey", color = "#cccccc" }
});
})
.Events(e => e
.DataBound("onSchedulerOpen")
)
)
==== JAVASCRIPT I AM TRYING TO USE TO SWITCH VIEW ON PAGE LOAD - BUT JUST RENDERS EMPTY PAGE ====
// setup the page
$(document).ready(function () {
// set to day view in the diary if a certain date has been passed in via querystring
if (....) {
var scheduler = $("#diary").data("kendoScheduler");
scheduler.view("day");
}
})
Hi , is it better to configure the kendo component using k-options in the angular controller or within the html.
is there any advantage./disadvantage to either?
thank you.
<select id ='ddl_general_qualite' kendo-drop-down-list k-ng-model = "mvEdit.CodeQualite" k-data-source = "Qualite" k-data-value-field = "' Code '" k-data-text-field = "'Libelle'"> </ select>This is the bug: http://screencast.com/t/djgiG4OBa
Kendo.all.js focusTable function is the beginning of the problem. We worked through
from there to identify where the problem is Lines :62024-62026
We commented these lines out and then the bug been fixed.
//else {
//
table[0].focus(); //because preventDefault bellow, IE cannot focus the table
alternative is unselectable=on
//}
Hope this feedback can make your product better.
my Kendo Splitter is as below.
@(Html.Kendo().Splitter() .HtmlAttributes(new { style = "height:590px;", id = "mainSplitter" }) .Orientation(SplitterOrientation.Horizontal) .Panes(horizontalPanes => { horizontalPanes.Add() .HtmlAttributes(new { id = "left-pane" }) .Size("246px") .Collapsible(true) .Content(@<text></text>); horizontalPanes.Add() .HtmlAttributes(new { id = "right-pane", style = "overflow:hidden;" }) .Content(@<iframe id="tabsContent_iframe" src='' data-src='' style="width:100%;height:100%;"></iframe> ); }))I have a button outside the splitter used to toggle the left-pane which worked perfectly.
Now, if I used the same button inside my iframe and make the call. It doesn't work.
I tried doing it in couple of ways as below:
1)
var parentSplitterId = parent.$('#mainSplitter').data("kendoSplitter"); var parentLeftTogglePane = parent.$('#full-pane');// , window.parent.document); parentSplitterId[parentLeftTogglePane.width() > 0 ? "collaspe" : "expand"](parentLeftTogglePane);2)
var parentSplitterId = window.parent.document.getElementById('mainSplitter');var parentLeftTogglePane = $('#full-pane', window.parent.document);var splitter = $("#parentSplitterId").data("kendoSplitter");splitter[leftTogglePane.width() > 0 ? "collaspe" : "expand"](leftTooglePane);
I am not able to understand where I am going wrong or what I'm missing. Please guide me out here.
Thanks
I created a demo based on standard dropdown MVVM demo which shows the behavior. For some reason DropDownList doesn't set it's value binding destination in case data-value-field attribute is not present. If you uncomment my attribute
comment-data-value-field="ProductID"example works fine.
But it took me a while to figure out what's missing there. I can't understand why I must specify data-value-field even though I set data-value-primitive="false", so data-value-field isn't used in any case. Documentation also says that dataValueField could be absent.

First off I'd just like to say how wonderful KendoUI is. I got it working on my site in a matter of minutes thanks to your great docs and demos.
One thing I can't figure, and maybe I missed something obvious. I find it easy enough to set one of the inlcuded CSS styles, and I can insert the style selector drop box with <select id="skinSelector" class="skinSelector"></select>
So how do I populate it with the available styles such as you have in most of your demos?
Thanks.
I have an MVVM application using Kendo Grid, and I want to display hierarchy (nested grid). I am not able to display the hierarchy data. How can I get the hierarchy records to display?
cshtml code:
<div id="custOrderGrid" data-role="grid" data-resizable="false" data-navigatable="true" data-editable="true" data-pageable="false" data-scrollable="true" onscroll="true" data-detail-template="child-template" data-columns="[ { 'field': 'OrderID', 'title': '<b>Order #', 'width': 65 }, { 'field': 'LineNo', 'title': '<b>Line Number', 'width': 65 }, { 'field': 'ItemNo', 'title': '<b>Item Number', 'width': 65 }, { 'field': 'Desc', 'title': '<b>Description', 'width': 150 } ]" data-bind="source: orderSearchResults" style="height: 55%"></div><script id="child-template" type="text/x-kendo-template"> <div data-role="grid" data-bind="source: obj2" data-columns="[ { field: 'name' }, { field: 'oid' } ]"></div></script>
typescript code
orderSearchResults = new kendo.data.DataSource({ schema: { model: { id: "OrderID", fields: { LineNo: { type: "string" }, ItemNo: { type: "string" }, Description: { type: "string" } } } }, data: [ { OrderID: "L44ZX4", LineNo: "15", ItemNo: "*X1WCJH", Description: "CDF9X2XSB", obj2: [{ name: 'a1', oid: 1 }, { name: 'b1', oid: 2 }, { name: 'c1', oid: 3 }] } ] });
How can I get the hierarchy data to display?