How to add onclick to inside visual HTML content? https://docs.telerik.com/kendo-ui/controls/charts/how-to/various/html-in-axes-labels
I have two datasource, how to achieve overlay one datasource to another datasource bar like in this example https://docs.telerik.com/kendo-ui/knowledge-base/chart-overlay-bar-series
<
div
id
=
"view"
>
<
div
id
=
"grid"
data-role
=
"grid"
data-editable
=
"false"
data-columns
=
"[{ 'field': 'Name' }, { 'field': 'Version'}]"
data-bind
=
"source: releases"
>
</
div
>
</
div
>
and a view model defined so...
var
viewmodel = kendo.observable({
releases:
new
kendo.data.DataSource({
schema: {
model: {
id:
"Id"
,
fields: {
Id: { type:
"string"
},
Name: { type:
"string"
},
Version: { type:
"string"
},
CreatedOn: { type:
"datetime"
}
}
}
},
transport: {
read: {
url:
"/Release/Index?handler=List"
,
type:
"jsonp"
}
}
})
});
When I try and render the page, the controls show, but there is no data, instead I get a 400 error. More reading tells me about anti-forgery tokens and how to set the header on my post request, so I add this to the top of my page....
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf
And, I set the header for the call with the anti forgery token, with this in my client side code...
$(
function
() {
const requestVerificationToken =
'@Xsrf.GetAndStoreTokens(HttpContext).RequestToken'
;
const beforeSend = req => req.setRequestHeader(
'RequestVerificationToken'
, requestVerificationToken);
const grid = $(
"#grid"
).getKendoGrid();
grid.dataSource.transport.options.read.beforeSend = beforeSend;
grid.data.read();
});
Now when I call my page, I get "Cannot read property 'read' of undefined."
Everything I've read suggests that I'm doing it right!
What am I not doing?
Are there any updates on this topic ? Since I am using Kendo UI slider with razor view having version 2017.2.621.545 and I am not able to get it works in mobile devices specially on iPhone.
The code is as follows -
@(Html.Kendo().SliderFor(m => m.PercentChanceClose)
.Name("PercentChanceClose")
.ShowButtons(true)
.Tooltip(true)
.Max(100)
.Min(0)
.SmallStep(5)
.LargeStep(10)
.Events( e => e.Change("SliderChange"))
.IncreaseButtonTitle("Perecent(%) Chance Close")
.HtmlAttributes(new { @class = "form-control"})
)
JavaScript function -
function SliderChange(e) {
if (e== null) {
SliderValue(50);
}
else {
SliderValue(e.value);
}
}
function SliderValue(x) {
var top = $("#PercentChanceClose").closest(".k-slider-wrap");
if (x >= 0 && x <= 24) {
$(".k-slider-track", top).css("background-color", "#00ff00");
$(".k-slider-selection", top).css("background-color", "#00ff00");
}
else if (x >= 25 && x <= 74) {
$(".k-slider-track", top).css("background-color", "#ffa500");
$(".k-slider-selection", top).css("background-color", "#ffa500");
}
else {
$(".k-slider-track", top).css("background-color", "#ff0000");
$(".k-slider-selection", top).css("background-color", "#ff0000");
}
}
I've created a simple Odata service that reads the contents of a single local SQL table. My service works correctly, I've checked in Postman, but the Kendo UI grid throws the following error:
Uncaught TypeError: Cannot read property '__count' of undefined
I checked entries on the board, and I've seen several that refer to the version of Odata. They imply that you need to use an older version of OData to work with the grid. The version I'm using is v4.0.30319. Will this version work with Kendo UI grid? Or does the error point to something else?
here's my html:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="styles/kendo.common.min.css" rel="stylesheet" />
<link href="styles/kendo.default.min.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script src="js/kendo.all.min.js"></script>
</head>
<body>
<div id="example">
<div id="grid"></div>
<script>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "//localhost:49666/CustomerComplaintDataService.svc/Complaints"
},
schema: {
model: {
fields: {
RecordNumber: { type: "number" },
Date: { type: "date" },
Brand: { type: "string" },
Filter_part_number: { type: "string" },
PlantMfrgLoc: { type: "string" },
Date_code: { type: "string" },
Person_talked_to: { type: "string" },
Phone_number: { type: "string" },
Company_Name: { type: "string" },
Product_Complaint: { type: "string" },
Action_taken: { type: "string" },
Results: { type: "string" },
Call_taken_by: { type: "string" },
Customer_Required_Response: { type: "string" },
Risk_Level: { type: "string" }
}
}
},
pageSize: 20,
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
height: 550,
filterable: true,
sortable: true,
pageable: true,
columns: [{
field: "RecordNumber",
filterable: false
},
"Brand",
{
field: "Date",
title: "Date",
format: "{0:MM/dd/yyyy}"
}, {
field: "Product_Complaint",
title: "Product Complaint"
}, {
field: "Action_taken",
title: "Action Taken"
}
]
});
});
</script>
</div>
</body>
</html>
Thanks in advance,
Mark
Hello, I have a Menu widget as a child of a Toolbar. I am disabling the menu using the following code:
myToolbar.enable(myMenu, false);
This correctly shows the menu widget as disabled (i.e. it's grayed out), but when I click the menu, it is still displaying the drop down menu under the button. Shouldn't calling enable with a value of false cause click events to be ignored? How can I accomplish this?
Thanks in advance
David