01.(function() {02. 03.jQuery(document).ready(function() {04. jQuery('#datepicker1').myKendoDatepicker({05. disabled: [new Date('12/25/2016').getTime(), 0, 6]06. });07.});08. 09.jQuery.fn.myKendoDatepicker = function(options) {10. jQuery(this).each(function() {11. var dp = MyKendoDatepicker().init(this, options);12. });13. return this;14.};15. 16.var MyKendoDatepicker = function(el) {17. return {18. defaults: {19. disableDates: function(date) {20. console.log(this);21. return date && (this.disabled.indexOf(date.getTime()) !== -1 || this.disabled.indexOf(date.getDay()) !== -1);22. },23. },24. 25. init: function(el, options) {26. this.opts = jQuery.extend(true, this.defaults, options);27. return jQuery(el).kendoDatePicker(this.opts);28. },29. 30. };31.};32. 33.})();I'm trying to create a wrapper that will allow us to set up default functionality for our datepicker. The previous code is just a simple starting point to illustrate my problem--I will be implementing more than just disabled dates. Unfortunately, I am not able to get a hold of my wrapper or even the actual input element once inside your "Datepicker" or "Calendar" objects (line 20). Any suggestions on how to accomplish my requirements? Am I missing something that would let me pass this object or grab the input the datepicker is acting upon (where I could place a reference to my object)?
thanks for you help.
david
If I select one file and upload it to .NET as List<HttpPostedFileBase>, the file HttpPostedFIleBase.FileName property, which includes the file's complete path, has what I would expect for escaped strings - double backslashes, for example C:\\FirstDir\\Foo.txt
But if I select multiple files and upload them, the files have double double (quadruple) backslashes: C:\\\\FirstDir\\\\Foo.txt.
Is this known? Can anyone confirm? From what I can tell the full paths are coming from .NET, not JavaScript or Kendo, but I want to be sure.
Thanks.
Hi,
Can you give me some advice on how to use angular translate inside of widget configurations?
Because ng-translate works async it seems ugly wrapper code is necessary like the one below.
Only the grid widget seems to support direct usage of translate like this:
... "columns": [ { "title": "{{'Tenant.Users.UserTab.FirstName' | translate}}", "field": "FirstName",...I couldn't get it working with other widgets. Am I missing an important detail?
$translate(['Core.Buttons.Ok', 'Core.Buttons.Cancel']).then(function(t) { $scope.colorOptions = { buttons: true, preview: true, input: true, messages: { apply: t['Core.Buttons.Ok'], cancel: t['Core.Buttons.Cancel'] } } });
<input kendo-color-picker ng-model="color1" k-options="colorOptions" />
Thanks a lot!

HI
I have an issue in kendo combobox I added a tooltip in kendo combobox dropdown list, the issue is when I click the tooltip in the combobox the dropdown was automatically closed. I want the when the tooltip dialog opens then the corresponding combobox dropdown list should not close. I am stuck in this issue help me out.
I used both the e.Preventdefault and e.stoppropagating but its not working. The following code that I used for the tooltip click event and I attached the screenshot of my issue.
comboBox.list.find('.info-MultiComboBox', '.cogInfo', 'cog-widget').click(function (e) {
// For some reason, this click event causes the dropdown to close. Calling preventDefault() stops this behavior.
e.preventDefault();
});
I have a Kendo spreadsheet widget inside a Kendo window widget. On my screen I have 2 Kendo windows. There is a button to toggle between both windows being 50% height and 100% width, and 100% height and 50% width. I use a custom function here to size and align the windows.
The way I actually change the position is below:
myWindow.wrapper.css({
top: top,
left: left,
width: width,
height: height
});
However, when I do this, my spreadsheet components inside the windows are not resized. The spreadsheet div with the scrollbar is resized, but not the actual div which holds the spreadsheet cells (image attached).
Thanks!
Hi, I have a custom function which opens 4 Kendo windows, inside a loop, one at a time. Each window has a Kendo spreadsheet component inside it already, populated with data. This crashes the browser and gives the following error:
angular.js:21778 RangeError: Maximum call stack size exceeded
at s (kendo.all.js:103803)
at s (kendo.all.js:103810)
at s (kendo.all.js:103810)
at s (kendo.all.js:103805)
at s (kendo.all.js:103805)
at s (kendo.all.js:103810)
at s (kendo.all.js:103810)
at s (kendo.all.js:103810)
at s (kendo.all.js:103810)
at s (kendo.all.js:103810)
Any ideas?
I have read all the Threads having this type of discussion based on that I gave Model Id as well. Aslo tried function for Edit and Delete URLs. but no luck.
This code was working earlier after that I added two more grid (which is commented right now) after that all Edit/Delete started coming as operation = create.
Here is the code.
<script>
$m = jQuery.noConflict();
</script>
$m("#siteInspectiongrid").kendoGrid({
dataSource: {
error: function (e) {
var msg = e.xhr.responseText;
var String = msg.substring(msg.lastIndexOf(":") + 1, msg.lastIndexOf(";"));
document.getElementById('errorMessage').innerText = String + "!!";
},
transport: {
read: {
url: crudServiceBaseUrl + "/SiteInspectionInfo?userGroup=" + userGroupConfiguration,
dataType: "json"
},
update: {
url: crudServiceBaseUrl + "/SiteInspectionInfo/Update?userGroup=" + userGroupConfiguration,
dataType: "json",
type: "PUT",
contentType: "application/json",
charset: "utf-8"
},
create: {
url: crudServiceBaseUrl + "/SiteInspectionInfo/Create?userGroup=" + userGroupConfiguration,
dataType: "json",
type: "POST",
contentType: "application/json",
charset: "utf-8"
},
destroy: {
url: crudServiceBaseUrl + "/SiteInspectionInfo/Delete?userGroup=" + userGroupConfiguration,
dataType: "json",
type: "DELETE",
contentType: "application/json",
charset: "utf-8"
},
parameterMap: function (options, operation) {
debugger;
if (operation !== "read" && operation !== "create" && options.models) {
return JSON.stringify({
'ReaderGroupID': options.models[0].ReaderGroupID,
'InspectionPercentage': options.models[0].InspectionPercentage,
'modifiedDate': options.models[0].modifiedDate,
'modifiedBy': options.models[0].modifiedBy,
'Active': options.models[0].Active,
'StaffType': options.models[0].StaffType,
'StaffTypeID': options.models[0].StaffTypeID
});
}
if (operation == "create" && options.models) {
return JSON.stringify({
'ReaderGroupID': options.models[0].readerGroupId.ReaderGroupID,
'InspectionPercentage': options.models[0].InspectionPercentage,
'createDate': options.models[0].createDate,
'createdBy': aliasName,
'modifiedDate': options.models[0].modifiedDate,
'modifiedBy': aliasName,
'StaffType': options.models[0].StaffId.StaffId,
'Active': options.models[0].Active
});
}
}
},
batch: true,
pageSize: 5,
schema: {
model: {
id: "Id",
fields: {
SiteCode: { editable: false, nullable: false },
SiteName: { editable: true, nullable: false },
ReaderGroup: { editable: true, nullable: false },
DoorRelay:{editable: true , nullable:false},
StaffType: { editable: true, nullable: false },
InspectionPercentage: { editable: true, nullable: true },
createdBy: { editable: false, nullable: true },
createDate: { editable: false, nullable: true },
modifiedBy: { editable: false, nullable: true },
modifiedDate: { editable: false, nullable: true },
Active: { editable: true, type: "boolean", defaultValue: true }
}
}
}
},
sortable: {
mode: "single",
allowUnsort: false
},
selectable: "multiple row",
pageable: {
buttonCount: 5
},
scrollable: false,
navigatable: true,
toolbar: [{ name: "create"
}],
edit: function (e) {
//======================================================
// Code to look for `hideMe` attribute on a column.
//======================================================
e.sender.columns.forEach(function (element, index /*, array */) {
if (element.hideMe) {
e.container.find(".k-edit-label:eq(" + index + "), "
+ ".k-edit-field:eq( " + index + ")"
).hide();
}
});
//======================================================
// End column hiding code
//======================================================
},
columns: [
{
field: "SiteCode",
title: "SiteCode",
hidden: true
},
{
field: "SiteName",
title: "SiteName"//,
// editor: siteDropDownEditor
},
{
field: "ReaderGroup",
title: "ReaderGroup"//,
//editor: readerGroupDropDownEditor//,
// template: '<a href="\\#" onclick="ReaderGroupDetails(#=ReaderGroupID# )">#=ReaderGroup#</a>'
},
{
field: "ReaderGroupID",
title: "ReaderGroupID",
hidden: true
},
{
field: "DoorRelay",
title: "DoorRelay",
hidden: true
},
{
field: "SearchRelay",
title: "SearchRelay",
hidden: true
},
{
field: "StaffType",
title: "StaffType"//,
// editor: staffDropDownEditor
}
,
{
field: "StaffTypeID",
title: "StaffTypeID",
hidden: true
}
,
{
field: "InspectionPercentage",
title: "Random %"
},
{
field: "createdBy",
title: "CreatedBy",
hideMe: true
}
,
{
field: "createDate",
title: "CreateDate",
hideMe: true
}
,
{
field: "modifiedBy",
title: "ModifiedBy",
hideMe: true
},
{
field: "modifiedDate",
title: "ModifiedDate",
hideMe: true
}
,
{ field: "Active", title: "Activated",
template: "<input type=\"checkbox\" #= Active ? checked='checked' : '' # class=\"check_row\"/>"
}
,
{ command: ["edit", "destroy"], title: "", width: 250 }
],
editable: {
mode: "inline"//,
// template: kendo.template($("#popup_editor").html())
}
});
I'm populated the grid with a long running process.
I have this loop, it takes about 10 seconds to get 5 results, but let's say there are 20 results.
How do I add the 5 results to the grid and keep appending to it as the results come in?
I'm using asp.net mvc to get the data.
I saw someone ask this a while back, but was just wondering if this feature has been added or anything.
Thanks!