dataSource: dataSource,
excelExport: exportExcel,
columnMenu: true,
editable: "inline",
cancel: function (e) {
var grid = this;
var rowUid = e.container.data("uid");
setTimeout(function () {
grid.element.find("tr[data-uid='" + rowUid + "'] .checkBoxEditor").kendoSwitch({
messages: {
checked: "@Mui.Yes",
unchecked: "@Mui.No"
}
});
});
},
dataBound: function () {
this.tbody.find(".checkBoxEditor").kendoSwitch({
messages: {
checked: "@Mui.Yes",
unchecked: "@Mui.No"
}
});
},
function checkBoxEditor(container, options) {
$('<input type="checkbox" name="' + options.field + '"/>')
.appendTo(container)
.kendoSwitch({
messages: {
checked: "@Mui.Yes",
unchecked: "@Mui.No"
}
});
}
I have a strange problem, that only happens to some users.
The data is not shown for some users, although there is data. It's a really complexed application, so I hope I can give enough information.
function getWorkListItems() {
setFieldValues();
options = localStorage["grid-options" + viewStatesFilter];
var gridSettings = {
selectable: "multiple row",
sortable: true,
filterable: true,
pageable: {
refresh: true,
pageSizes: [10, 20, 50, 100],
buttonCount: 5
},
resizable: true,
autoBind: !options,
columns: [
{
field: "EncryptedID",
hidden: true
},
{
field: "RequestHandler",
title: "Behandelaar",
},
{
field: "SpecialCharacteristicsIndicator",
title: "Bijzonder kenmerk",
filterable: { multi: true }
},
{
field: "CustomerRequestID",
title: "Aanvraag ID",
},
{
field: "ExternalID",
title: "SD nummer"
},
{
field: "Facility",
title: "Vestiging"
},
{
field: "PostalCode",
title: "Postcode",
width: '80px'
},
{
field: "BuildingNumber",
title: "Huisnummer",
width: '80px'
},
{
field: "Status",
title: "Status"
},
{
field: "DocumentDateTime",
title: "Aanvraag datum",
format: "{0: dd-MM-yyyy}"
},
{
field: "PlannedWeekNumber",
title: "Wensweek"
},
{
field: "TypeOfWork",
title: "Dienst"
},
{
field: "SubTypeOfWork",
title: "Subdienst."
},
{
field: "ConcernsMultipleAddressesIndicator",
title: "Meerdere adressen",
filterable: { multi: true }
},
{
field: "IsCombiRequestIndicator",
title: "Solo/Combi",
filterable: { multi: true }
}
],
change: function () {
var row = this.select();
var id = this.dataItem(row[0]).EncryptedID;
window.location = 'Bpm/Werkvoorraad/WerkvoorraadDetails.aspx?rowtag=' + id + '&source=' + window.location;
},
sortable: {
allowUnsort: false
}
};
var customFields = [{
field: "DocumentDateTime",
filterable: {
ui: function (element) {
element.kendoDatePicker({
format: '{0: d-M-yyyy}'
});
element.attr("readonly", true);
},
operators: {
string: {
eq: "Is gelijk aan",
gt: "Is na",
lt: "Is voor",
}
}
},
format: '{0: d-M-yyyy}',
}, {
field: "BuildingNumber",
sortable: {
compare: function compare(a, b) {
return a.BuildingNumber - b.BuildingNumber;
}
}
}];
$.each(customFields, function (customFieldIndex, customField) {
$.each(gridSettings.columns, function (columnIndex, column) {
if (column.field == customField.field) {
if (customField.sortable) {
column.sortable = customField.sortable;
}
if (customField.template) {
column.template = customField.template;
}
if (customField.headerTemplate) {
column.headerTemplate = customField.headerTemplate;
}
if (customField.filterable) {
column.filterable = customField.filterable;
}
if (customField.filter) {
column.filter = customField.filter;
}
if (customField.format) {
column.format = customField.format;
}
}
});
});
searchGrid = $("#searchGrid").kendoGrid(gridSettings).data("kendoGrid");
searchGrid.thead.find("[data-field=IsSelected]>.k-header-column-menu").remove();
searchGrid.thead.find("[data-field=ID]>.k-header-column-menu").remove();
loadData();
}
function loadData() {
debugger;
var url = BpmCore.GetRelativeWebUrl() + "_vti_bin/DeviationService.svc/GetGebruikersVestigingen";
$.ajax({
type: "POST",
url: url,
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: null,
xhrFields: {
withCredentials: true
},
success: function (result) {
getGebruikersVestigingenSuccessCallback(result);
},
error: function (e) {
getGebruikersVestigingenErrorCallback(e);
}
});
}
function getGebruikersVestigingenSuccessCallback(result) {
var request = {
CustomerRequestID: $("#txtAanvraagID").val(),
States: $("#selStates").val() == null ? states : $("#selStates").val(),
RequestHandler: $("#txtBehandelaar").val(),
Street: $("#txtStraat").val(),
PostalCode: $("#txtPostcode").val(),
BuildingNumber: $("#txtHuisnummer").val(),
City: $("#txtPlaats").val(),
FacilityIDs: result.data[0].Vestiging
};
enexis.helpers.storage.setStorage(viewStatesFilter, request, "json");
var ds = new kendo.data.DataSource({
transport: {
read: function read(options) {
enexis.services.customerrequests.find(request, function (result) {
if (result.Success) {
} else {
enexis.helpers.forms.showError(result.ErrorMessages);
}
options.success(result.Items || []);
searchGrid.refresh();
}, function (result) {
options.error(result);
});
}
},
schema: {
model: {
fields: {
DocumentDateTime: {
type: 'date',
parse: function (date) {
return kendo.parseDate(date, "dd-MM-yyyy");
}
}
}
}
},
pageSize: 20,
sort: { field: "DocumentDateTime", dir: "asc" }
});
searchGrid.setDataSource(ds);
searchGrid.dataSource.read();
searchGrid.thead.find("[data-field=IsSelected]>.k-header-column-menu").remove();
searchGrid.thead.find("[data-field=ID]>.k-header-column-menu").remove();
if (options) {
searchGrid.setOptions(JSON.parse(options));
}
}
At first Id didn't have the line
searchGrid.dataSource.read();
I added this, because sometimes the read function of the grid is not fired (for users who get the data this was working)
When I added that line the read function was fired and the data was collected (through the webapi). I can see that because result.Items countains the items.
I also added the line
searchGrid.refresh();
after
options.success(result.Items || []);
But nevertheless, the data is not shown in the grid, only when I manually click the refresh button of the grid (then the read function fires again).
It is really strange why it works for some users and for other users it isn't working.
FYI this is build in a SharePoint application,
Using this example: https://demos.telerik.com/kendo-ui/spreadsheet/server-side-import-export
I can't find the server-side script being run by this config: saveUrl: "/kendo-ui/spreadsheet/upload"
Where can I find this server-side script?
Hi,
I had to add the grid to part of my gantt page in the app and as soon as I added the grid, gantt drag and drop of columns started to fail.
On column drop lib fails with the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'lockable')
at init._allowDragOverContainers (kendo.all.js:311085:87)
at init._dropTargetAllowed (kendo.all.js:311085:87)
at init.drop (kendo.all.js:311085:87)
at init.trigger (kendo.all.js:311085:87)
at init._trigger (kendo.all.js:311085:87)
at init._drop (kendo.all.js:311085:87)
at kendo.all.js:311085:87
at init._withDropTarget (kendo.all.js:311085:87)
at init._end (kendo.all.js:311085:87)
at init.trigger (kendo.all.js:311085:87)
Problem is reproducible in the following Dojo
To reproduce issue, just try to change the order of the columns in the gantt widget.
Result: Widget breaks on drop and any drag or drop is not possible. Browser console shows error described above.
Expected result: Columns reordered
Tested with Chrome and Firefox.
If there is anything else I can do to help, please let me know.
I want Kendo From to be readonly for all control, how do I do that?
Please help me, thanks!
Hello
I need your support, please, for the Scheduler (Kendo JQuery UI v2022.2.510)
I have 2 problems: the special characters in the description (example: euro symbol) and the multilines description of the appointments.
I would like to show next invoices to be paid.
The scheduler must be on mounth show, and all event are all day event.
On the event I need to show the number of document, buisness name and the amounth.
I'm trying to implement more filds in schema but the program ignore that.
I also tried to insert html tag in the description filed
(example:
<span class='IntestazioneDocumento'>PA / 1234567890 del 01/01/2000</span>
<span class='aDitta'>Alla ditta Business</span>
<span class='nRata'>Payment 1 di 1</span>
<span class='importo'>Tot. documento 123,45 €</span>
)
but the tasg are showed as text.
In every case, the height of the result cell is too short to show all information.
I use the code
kendo.ui.progress($("#scheduler"), false);
urlData = url
$("#scheduler").kendoScheduler({
height: 600,
views: [
"day",
"week",
{ type: "month", selected: true},
"year"
],
timezone: "Europe/Rome",
allDayEventTemplate: $("#event-template").html(),
eventTemplate: $("#event-template").html(),
dataSource: {
batch: true,
transport: {
read: {
url: urlData,
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: " json"
},
update: {
},
create: {
},
destroy: {
}
},
schema: {
model: {
id: "taskId",
fields: {
taskId: { from: "TaskID", type: "number" },
title: { from: "Title", defaultValue: "No title", validation: { required: true } },
start: { type: "date", from: "Start" },
end: { type: "date", from: "End" },
startTimezone: { from: "StartTimezone" },
endTimezone: { from: "EndTimezone" },
description: { type: "html", from: "Description" },
recurrenceId: { from: "RecurrenceID" },
recurrenceRule: { from: "RecurrenceRule" },
recurrenceException: { from: "RecurrenceException" },
ownerId: { from: "OwnerID", defaultValue: '' },
isAllDay: { type: "boolean", from: "IsAllDay" },
IntestazioneDocumento: { from: "IntestazioneDocumento" },
RagioneSociale: { from: "RagioneSociale" },
}
}
}
},
editable: false,
resources: [
{
field: "ownerId",
title: "Owner",
dataSource: [
{ text: "CENTRAL", value: 0, color: "#0000ff" },
{ text: "LOGGIA", value: 1, color: "#f8a398" },
{ text: "GIOTTO", value: 2, color: "#2572c0" },
{ text: "P_COMM", value: 3, color: "#118640" }
]
}
]
});
$("input[ name=showFarm ]").change(function(e) {
var checked = $.map($("input[ name=showFarm ]:checked"), function(checkbox) {
return parseInt($(checkbox).val());
});
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.dataSource.filter({
operator: function(task) {
return $.inArray(task.ownerId, checked) >= 0
}
});
});
});