I have two Kendo Schedulers. In the first one the WorkDayStart and WorkDayEnd should be custom to the day(s) being viewed. They are not static at one single time. If I am viewing one single day, I am sure I could inject some Javascript to find these and update them, then rerender the scheduler. But when viewing a week that would not help. Really they need to be a function. Is this possible?
The second scheduler is grouped by a resource of an Employee. So in this case it is more complicated. I have this one locked down to viewing only a single day view (or other views that don't include slots that may be closed like Agenda). But the columns here are dependent on the employee's availability for the day selected. So again a function is needed.
Alternatively, digging in the kendo.all.js, I see a property called "slotTemplate" but this doesn't seem to be exposed in MVC. Is there a workaround using this?
[EDIT]: I finally found the SlotTemplate as part of the views in MVC. Will play around here and possibly I can solve this on my own.
[EDIT 2]: I did get SlotTemplate working, but the real solution is to fix the WorkDayStart and WorkDayEnd. Let's say this is a program for a store. Bob logs in. Bob sees his own schedule on one tab, and the store schedule on another tab. Bob works different hours per day. The store is open different hours per day. It's not always the same. When viewing a week we need to be expanded to the most open day. When viewing a single day we should match that day.
Here's a SlotTemplate tagged in CSHTML:
views.DayView(v => v.Selected(true)).SlotTemplateId("shopSlotTemplate");<script id="mySlotTemplate" type="text/x-kendo-template">
#= getSlotTemplate(data, @loggedInEmployeeId) #
</script>
<script id="shopSlotTemplate" type="text/x-kendo-template">
#= getSlotTemplate(data) #
</script>
<script id="acSlotTemplate" type="text/x-kendo-template">
#= getSlotTemplate(data, 0) #
</script>
function getSlotTemplate(data, employeeId) {
// Get employee ID if not passed in. If still not found then this scheduler is not grouped this way.
if (employeeId === undefined) {
employeeId = data.resources().EmployeeId;
}
let isClosed = isShopClosed(shopSchedule.Shop, data.date);
if ((!isClosed) && (employeeId > 0) && (shopSchedule["Employee" + employeeId] !== undefined)) {
isClosed = isShopClosed(shopSchedule["Employee" + employeeId], data.date);
}
return "<div class=\"" + (isClosed ? "k-nonwork-hour" : "") + "\"> </div>";
}
This required new CSS since the TD element has margins.
div.k-scheduler-content > table > tbody > tr > td > div {
margin: -4px -0.5em;
height: calc(100% + 8px);
width: calc(100% + 1em);
}The end result is that the grid for the scheduler appears how I want it.
But working hours are still inaccurate. They are based on a single date and don't change as I move between days.
What is returned in variable grid in following code line?
var grid = $("#GridCompetency0").data("kendoGrid");
How do I use to access the fields of my Model?
I am using it in the following onChange function.
function onChange(e)
Hi, I want to create a bullet chart in the form of group data and set a unique target data, color, tooltip-template for each bar like "column chart" in picture but I can't find how to bind data for bullet chart
Is there a way to make the chart look like the example? Please advise if there is a more suitable graph format to display this type of data.
var testData3 = [
I have a kendo grid with server side paging and client side sorting. while clicking the sort in the grid, data fetch request(Request to fetch data from server) is getting triggered from frontend. but I'm using the client side sorting it shouldn't be the case. Is it possible to restrict it, without calling the server, Sort should be done in the frontend level. I hereby attach the my code sample images for your Reference. Anyone can point me to the right direction? Thanks.
I want the chart in this dojo example to be in descending order. Currently it is in ascending order. I used the sort on the datasource but it doesn't seem to be reflecting in the chart. I'm sure i am missing something simple here but any help would be appreciated.
https://dojo.telerik.com/UNENAfos
Thanks.
Hi,
I would like to have paging on my grid and I am using standard paging options as recommended.
However one of users would like to start with option "Show all", and I can achieve this with setting page sizes, but not pageSize property. Grid automatically falls back to All, which is ok - display of number of records is broken in this case, and instead of showing 135 - 135 of 135 items, it says NaN - NaN of 135 items.
Is the way I am setting grid to use all as default wrong or there is a bug with this behavior?
For the example of behavior, please see the demo
Regards,
Vedad
i have two grids, one is a normal Kendo Grid, the Other is a TreeList grid; The regular kendoGrid, has events that fire when the user uses the Menu Filter or clicks the header when sorting. I need to capture when sort/filtering occurs; HOWEVER the TreeList grid doesnt seem to have such event??? i tried same/several renditions; the only one i see from the header Menu is when Columns are Hidden/Shown (e.g. columnShow: & columnHide:) - is there no event for columnMenuFilter (e.g. Set/Clear) and SORT (e.g. Asc/Desc)?
anyone please advise?
Hi,
We have a grid with virtual scroll enabled.
When double-clicking on the first 15 rows resize handles, it behaves correctly, i.e it automatically fits the columns size to max row width.
The problem occurs now when we begin scrolling horizontally the grid : starting to the 16th column (red backgrounded) resize handle double click action behaves weirdly. Sometimes it fires a scroll event without doing else, sometimes it resizes the column but in the wrong way by reducing width.
Check this JsFiddle to reproduce the problem. Problematic column are red backgrounded.
I have a Kendo DropdownList as follows :
$("#txtTag").kendoDropDownList({
dataTextField: "TagDesc",
dataValueField: "TagId",
optionLabel: " ",
dataSource: {
transport: {
read: {
dataType: "json",
url: "/Data/GetTag"
}
}
},
change: onChange,
filter: "contains"
});I have hidden one of the values by using
$("#txtTag_listbox li")[4].hidden = true;However, when I do a filter/search on the dropdown List , the hidden item also appears in that list. How do I prevent it to not appear it in the list.
