Hi,
How can i render a kendo datepicker inside a kendo script template? With the help of javascript?
here is a simple sample:
<script id="user-template" type="text/x-kendo-template">
<div id="column">
<input id="datePicker1" />
</div>
</script>
I have a grid that I'm trying to enable inline editing. Whenever I attempt to update a row error is thrown in the console. I've tried moving the editor into a separate editor with no luck. I removed the configuration column so there was just the Room displayName and the same thing happens so it is not an issue with the Multi-Select.
I am currently using Kendo UI v2021.1.330
In Chrome the error happens when the edit control loses focus and is
kendo.all.js:6566 Uncaught TypeError: Cannot read properties of undefined (reading 'data')
at init.setup (kendo.all.js:6566:106)
at init.create (kendo.all.js:6540:34)
at Object.<anonymous> (kendo.all.js:7640:42)
at Function.Deferred (jquery.min.js:2:29289)
at init._promise (kendo.all.js:7637:26)
at init._send (kendo.all.js:7663:44)
at init.sync (kendo.all.js:7395:60)
at init._change (kendo.all.js:8041:26)
at init.d (jquery.min.js:2:3873)
at init.trigger (kendo.all.js:164:37)
In Firefox the error happens when clicking update and is
function generateTemplate(configs) :string{
var arryDisplayNames = configs.map(function (a) { return a.displayName; });
var result = arryDisplayNames.join(", ");
return result;
}
let configurationDataSource = new kendo.data.DataSource({
serverFiltering: true,
transport: {
read: {
url: '/api/config',
data: function (opt) {
return {
roomId: 0
}
}
},
},
schema: {
model: {
id: "id",
fields: {
//id: { type: "number" },
displayName: { type: "string"}
}
}
}
})
let gridDataSource: kendo.data.DataSource = new kendo.data.DataSource({
autoSync: true,
transport: {
read: {
url: '/api/rooms/',
type: 'get',
dataType: 'json',
data: {
buildingid: roomBuildingId
}
},
update: {
url: '/api/rooms/',
type: 'post',
dataType: 'json'
}
},
schema: {
model: {
id: "RoomId",
fields: {
roomId: { type: 'number' },
buildingId: { type: 'number' },
displayName: { type: 'string' },
restricted: { type: 'boolean' },
isActive: { type: 'boolean' },
configurations: { type: 'object' },
owners: { type: 'object' },
}
}
}
});
let gridColumns: kendo.ui.GridColumn[] = [
{ field: "displayName", title: "Room" },
{
field: "configurations",
title: "Configurations",
editor: function (container,options) {
var input = $("<input name='Configurations' id='Configurations' >");
// append to the editor container
input.appendTo(container);
// initialize a multiselect
input.kendoMultiSelect({
dataTextField: "displayName",
dataValueField: "id",
dataSource: configurationDataSource // bind it to the brands array
}).appendTo(container);
},
template: "#= generateTemplate(configurations) #"
},
{ command: ["edit"], title: " "}
];
roomGrid = $('#rooms').kendoGrid({
dataSource: gridDataSource,
sortable: true,
groupable: true,
pageable: false,
editable: "inline",
selectable: "row",
columns: gridColumns
}).data('kendoGrid') as kendo.ui.GridHi!
When spreadsheet has may sheets and sheet bar has scroll buttons there is a problem with enter formula with link to sheet if tab of target sheet is not visible. Scrolling scrollbar stops editing mode.
To reproduce this, open dojo:
https://dojo.telerik.com/ETOsIzUP
then press "=" key (to open edit formula mode),
then press scroll right button on sheets bar (to open last sheet)
- editor mode stops and "A1" cell containts "=" char.
What is expected: possibility select any sheet in workbook to use in formula.
Kendo UI Spreadsheet 2022.1.119
Hi Support
Back in 2016, I asked the same question: https://www.telerik.com/forums/grid-setoptions-error-custom-commands-should-have-name-specified (but must have solvedtheissueanotherway).
Now, I have the same requirement (to persist the state of a grid: https://demos.telerik.com/kendo-ui/grid/persist-state)
Using Kendo UI v2021.3.1216, I still get the same error when I call grid.setOptions: "Custom commands should have name specified".
I have changed the "Persist state" grid demo (https://demos.telerik.com/kendo-ui/grid/persist-state) by just adding the following code to the grid setup:
toolbar: [
{ template: kendo.template($("#toolbar-template").html()) }
],
The toolbar template is simply:
<script id="toolbar-template" type="text/x-kendo-template">
x
</script>
The dojo: https://dojo.telerik.com/@mortenma71/EgoYILeS/2
It seems that the persisting grid state with a toolbar template is not possible. The saved options has an empty toolbar (see screenshot)
Could you help?
Thanks.
/Morten
Hello guys, I hope you are all well.
I have a question about the KendoUI version 2014.1.416 as I am facing some issues with the kendoSortable() function.
At the moment, the jQuery version is the latest (3.6.0) and I have also placed the latest jQuery Migrate version (3.2.2) but the .data("kendoGrid") function always returns an "undefined" result, meaning that it does not find the actual grid.
Do you happen to know whether the problem is the latest jQuery version or the syntax to get the kendoGrid?
Below I have placed the JS line of code to fetch the grid.
- code sample: var grid = e.detailRow.find(".js-filter-conditions-grid").data("kendoGrid");
Regards,
R

Hi
I use a set of floating action buttons where one of the buttons is used to show / hide the whole button set. As soon as I hide the buttons, this "toggle" button is repositioned to the bottom of the page which works very well by setting the alignOffset value with setOptions.
My problem is now, that the button seems to loose every other css style I've applied directly to the div that becomes the button. Hence I loose the assigned color/background-color and z-index.
Is this a bug or do I miss anything?
Regards
Alex

Hi
I am kinda stuck while trying to populate my Kendo Grid using Dynamic data list (List<ExapndoObject>).
I am working on ASP.NET Core MVC project and My Page Model code is successfully creating a list of data with Dynamic columns and values using the following code:
Page Model Code:
public async Task<IActionResult> OnGetGridDataAsync(string startDate, string endDate)
{
//Populating Dynamic List
var dataList = new List<System.Dynamic.ExpandoObject>();
var apiData = API call for data
foreach (var data in apiData)
{
dynamic newObject = new ExpandoObject();
newObject.Student = data.StudentName; //Student Column
var attendanceDays = API call for data
foreach (var attendanceDay in attendanceDays)
{
if (attendanceDay.Date >= DateTime.Parse(startDate) && attendanceDay.Date <= DateTime.Parse(endDate))
{
var attendanceSessionAttend = API call for data
var attendanceSession = API call for data
var SessionName = attendanceSession.Name + " (" + attendanceDay.Date.ToString("dd MMM") + ")";
AttendanceStatusDto attendanceStatus = null;
if (attendanceSessionAttend[0].AttendanceStatusId != null)
{
attendanceStatus = API call for data
AddProperty(newObject, SessionName, attendanceStatus.Code);
}
else
{
AddProperty(newObject, SessionName, "");
}
}
}
dataList.Add(newObject);
}
return new JsonResult(dataList);
}
private static void AddProperty(dynamic attendanceObject, string columnName, string columnValue)
{
var attendanceObjectDict = attendanceObject as IDictionary<string, object>;
if(attendanceObjectDict.ContainsKey(columnName))
{
attendanceObjectDict[columnName] = columnValue;
}
else
{
columnName = columnName.Replace(" ",String.Empty);
attendanceObjectDict.Add(columnName, columnValue);
}
}
JQuery code:
function populateGrid() {
$.ajax({
type: "GET",
url: '?handler=GridDate',
data: {
'startDate': firstday.toDateString(),
'endDate': lastday.toDateString()
},
contentType: "application/json; charset=utf-8",
success: function (result) {
// notify the data source that the request succeeded
console.log(result);
generateGrid(result);
},
error: function (result) {
// notify the data source that the request failed
options.error(result);
}
});
}
function generateGrid(response) {
var gridOptions = {
dataSource: response
};
$("#AttendanceTable").kendoGrid(gridOptions);
var grid = $("#AttendanceTable").data("kendoGrid");
};when running the project, It is showing only the Student Column but other dynamic columns are showing 'Invalid Template error'
Invalid template:'<tr class="k-master-row" data-uid="#=data.uid#" role='row'><td class="#= data && data.dirty && data.dirtyFields && data.dirtyFields['Student'] ? ' k-dirty-cell' : '' #" role='gridcell'>#= data && data.dirty && data.dirtyFields && data.dirtyFields['Student'] ? '<span class="k-dirty"></span>' : '' ##:data.Student==null?'':data.Student#</td><td class="#= data && data.dirty && data.dirtyFields && data.dirtyFields['MondaySession(28Feb)'] ? ' k-dirty-cell' : '' #" role='gridcell'>#= data && data.dirty && data.dirtyFields && data.dirtyFields['MondaySession(28Feb)'] ? '<span class="k-dirty"></span>' : '' ##:data.MondaySession(28Feb)==null?'':data.MondaySession(28Feb)#</td></tr>' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput='<tr class="k-master-row" data-uid="'+(data.uid)+'" role=\'row\'><td class="'+( data && data.dirty && data.dirtyFields && data.dirtyFields['Student'] ? ' k-dirty-cell' : '' )+'" role=\'gridcell\'>'+( data && data.dirty && data.dirtyFields && data.dirtyFields['Student'] ? '<span class="k-dirty"></span>' : '' )+''+$kendoHtmlEncode(data.Student==null?'':data.Student)+'</td><td class="'+( data && data.dirty && data.dirtyFields && data.dirtyFields['MondaySession(28Feb)'] ? ' k-dirty-cell' : '' )+'" role=\'gridcell\'>'+( data && data.dirty && data.dirtyFields && data.dirtyFields['MondaySession(28Feb)'] ? '<span class="k-dirty"></span>' : '' )+''+$kendoHtmlEncode(data.MondaySession(28Feb)==null?'':data.MondaySession(28Feb))+'</td></tr>';}return $kendoOutput;'Below is the console view of the page with data:
Please help me out.
Is there a way to make other svg pompatible with the pdf export?
Your charts are rendered as svg element and they are supported, but other chart doesn't:
http://dojo.telerik.com/eMUPu
Hi Team,
we are using kendo grid jquery version - 2016.2.607, and when the no of records are more than the screen size, and if user clicks on the one of the bottom records, page scrolls.
this is unwanted behavior and we want to stop this behavior.
from the earlier threads I could find that it could be due to "navigatable:true" as kendo control calls "scrollIntoView()" and that causes the above mentioned issue.
can you please confirm the issue? also can you suggest any work around.
