I've been working on a map project, and I had shapeClick working, but suddenly it stopped working. I was working on other parts of the page, but I don't think any of them would have caused this problem. I've been banging my head against it for 2 hours, and I still have no idea why it won't trigger the shapeClick event any more.
Here's the function I'm using to create the map and the onShapeClick function as well. I've got multiple bubble layers, but the one I've been trying to click on the bubbles for is the first one with the dataSource: BLOCKS.
function createMap() { $("#map").kendoMap({ center: [38.268107, -97.744821], zoom: 4,//These two options may be something to set to div options height: 400, layers: [{ type: "bing", imagerySet: "aerialWithLabels", key: "Ajo4NRDLFtd7zTT_LKi4lHrCZCWahx69-ZjmruTcGlBNdIPDUD--iWmlmWl5We_E" }, { type: "bubble", dataSource: BLOCKS, locationField: "Location", valueField: "Value", symbol: function(e) { var map = $("#map").data("kendoMap"); var location = e.location; var circleGeometry = new geom.Circle(e.center, e.dataItem.Value); //var rectGeometry = new geom.Rect([e.center[0] - 20, e.center[1] - 10], [e.center[0] + 20, e.center[1] + 10]); //alert(e.dataItem); //alert(e.shape); // Draw the circle shape // var circle = new draw.Circle(circleGeometry, { fill: { color: e.dataItem.Color, opacity: 0.7 }, stroke: { width: 0 } }); // Draw the text // var text = new draw.Text(e.dataItem.Name, e.center, {//e.dataItem.Name font: "12px sans-serif" }); // Align it in the circle center // // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-align // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-vAlign draw.align([text], circle.bbox(), "center"); draw.vAlign([text], circle.bbox(), "center"); circle.dataItem = e.dataItem; circle.bubbleType = "block"; //alert(1); $(circle).click(function () { alert(this); alert(this.dataItem); }); //alert(2); text.dataItem = e.dataItem; text.bubbleType = "block"; $(text).click(function () { alert(this); alert(this.dataItem); }); var symbol = new draw.Group(); symbol.append(circle, text); symbol.dataItem = e.dataItem; symbol.bubbleType = "block"; $(symbol).click(function () { alert(this); alert(this.dataItem); }); return symbol; } }, { type: "shape", dataSource: shapes } , { type: "bubble", dataSource: pingBubbles, locationField: "Location", valueField: "Value", symbol: function (e) { var map = $("#map").data("kendoMap"); var location = e.location; var circleGeometry = new geom.Circle(e.center, e.dataItem.Value); //var rectGeometry = new geom.Rect([e.center[0] - 20, e.center[1] - 10], [e.center[0] + 20, e.center[1] + 10]); //alert(e.dataItem); //alert(e.shape); // Draw the circle shape // var circle = new draw.Circle(circleGeometry, { fill: { color: e.dataItem.Color, opacity: 0.7 }, stroke: { width: 0 } }); // Draw the text // var text = new draw.Text(e.dataItem.Name, e.center, {//e.dataItem.Name font: "12px sans-serif" }); // Align it in the circle center // // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-align // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-vAlign draw.align([text], circle.bbox(), "center"); draw.vAlign([text], circle.bbox(), "center"); circle.dataItem = e.dataItem; circle.bubbleType = "ping"; text.dataItem = e.dataItem; text.bubbleType = "ping"; var symbol = new draw.Group(); symbol.append(circle, text); symbol.dataItem = e.dataItem; symbol.bubbleType = "ping"; return symbol; } }, { type: "bubble", dataSource: incidentBubbles, locationField: "Location", valueField: "Value", symbol: function (e) { var map = $("#map").data("kendoMap"); var location = e.location; var circleGeometry = new geom.Circle(e.center, e.dataItem.Value); //var rectGeometry = new geom.Rect([e.center[0] - 20, e.center[1] - 10], [e.center[0] + 20, e.center[1] + 10]); //alert(e.dataItem); //alert(e.shape); // Draw the circle shape // var circle = new draw.Circle(circleGeometry, { fill: { color: e.dataItem.Color, opacity: 0.7 }, stroke: { width: 0 } }); // Draw the text // var text = new draw.Text(e.dataItem.Name, e.center, {//e.dataItem.Name font: "12px sans-serif" }); // Align it in the circle center // // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-align // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-vAlign draw.align([text], circle.bbox(), "center"); draw.vAlign([text], circle.bbox(), "center"); circle.dataItem = e.dataItem; circle.bubbleType = "incident"; text.dataItem = e.dataItem; text.bubbleType = "incident"; var symbol = new draw.Group(); symbol.append(circle, text); symbol.dataItem = e.dataItem; symbol.bubbleType = "incident"; return symbol; } }, { type: "bubble", dataSource: SELECTEDBLOCKS, locationField: "Location", valueField: "Value", symbol: function (e) { var map = $("#map").data("kendoMap"); var location = e.location; var circleGeometry = new geom.Circle(e.center, e.dataItem.Value); //var rectGeometry = new geom.Rect([e.center[0] - 20, e.center[1] - 10], [e.center[0] + 20, e.center[1] + 10]); //alert(e.dataItem); //alert(e.shape); // Draw the circle shape // var circle = new draw.Circle(circleGeometry, { fill: { color: e.dataItem.Color, opacity: 0.7 }, stroke: { width: 0 } }); // Draw the text // var text = new draw.Text(e.dataItem.Name, e.center, {//e.dataItem.Name font: "12px sans-serif" }); // Align it in the circle center // // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-align // http://docs.telerik.com/kendo-ui/api/javascript/drawing#methods-vAlign draw.align([text], circle.bbox(), "center"); draw.vAlign([text], circle.bbox(), "center"); circle.dataItem = e.dataItem; circle.bubbleType = "block"; text.dataItem = e.dataItem; text.bubbleType = "block"; var symbol = new draw.Group(); symbol.append(circle, text); symbol.dataItem = e.dataItem; symbol.bubbleType = "block"; return symbol; } } ], shapeClick: onShapeClick }); } function onShapeClick(e) { alert('hola'); }As you can see, I tried adding click events to the symbol as well, but that's not working either.
In case it matters, here's the DataSource definition for BLOCKS:
var BLOCKS = new kendo.data.DataSource({ type: "odata", schema: { data: "data", model: { fields: { BlockId: { type: "number" }, Name: { type: "string" }, Value: { type: "number" }, Location: { type: "object" }, Color: { type: "string" }, CurrentRouteName: { type: "string" }, VehicleId: { type: "number" }, VehicleName: { type: "string" }, EmployeeId: { type: "number" }, EmployeeName: { type: "string" } } } } });
Hi, I have a partial view "_AccountUsers" with just the following grid:
@(Html.Kendo().Grid<LiteraSite.LiteraProjectSvc.UserDTO>((List<LiteraSite.LiteraProjectSvc.UserDTO>)TempData["AccountUsers"])
.Name("grdAccountUsers")
.Columns(columns =>
{
columns.Bound(p => p.Email).Title("Email").HtmlAttributes(new { @style = "padding-left: 8px;" });
columns.Bound(p => p.UserName).Title("Account Users").HtmlAttributes(new { @style = "padding-left: 5px;" });
columns.Bound(p => p.FirstName).Title("Account Users").HtmlAttributes(new { @style = "padding-left: 5px;" });
columns.Bound(p => p.LastName).Title("Account Users").HtmlAttributes(new { @style = "padding-left: 5px;" });
columns.Bound(p => p.Active).Title("Active").HtmlAttributes(new { @style = "padding-left: 5px;" }).Template(@<input @(item.Active ? "checked='checked'" : "") value='active' type='checkbox' />);
columns.Command(command =>
{
command.Edit().UpdateText("");
command.Destroy();
}).Width(170);
// columns.Command(command=> command.Custom("Delete").Action("DeleteUser","Administration")).Width(170);
})
.Pageable()
.Navigatable()
.Selectable(selectable => selectable.Enabled(true))
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Scrollable(src => src.Height(300))
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model => model.Id(p => p.UserID))
.Model(model=>model.Field(o=>o.Email).Editable(false))
.Model(model => model.Field(o => o.UserName).Editable(false))
.Model(model => model.Field(o => o.FirstName).Editable(false))
.Model(model => model.Field(o => o.LastName).Editable(false))
.Destroy(update => update.Action("DeleteUser", "Administration"))
.Update(update => update.Action("UpdateUser", "Administration"))
)
)
and the delete user action looks like this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult DeleteUser([Kendo.Mvc.UI.DataSourceRequest] Kendo.Mvc.UI.DataSourceRequest request,
UserDTO user)
{
(new Models.ProjectModel()).DeleteUser(user.UserID);
SetAccountUsers();
return Json(((List<UserDTO>)TempData["AccountUsers"]).ToDataSourceResult(request, ModelState));
}
here is where i load the partial view:
@{
ViewBag.Title = "User Administrator";
}
@section scripts {
@Styles.Render("~/Contents/Control/administrator")
<link href='@Url.Content("~/Contents/Styles/themes/kendo/kendo.common.min.css")' rel="stylesheet" />
<link href='@Url.Content("~/Contents/Styles/themes/kendo/kendo.metro.min.css")' rel="stylesheet" />
<script src='@Url.Content("~/Contents/Scripts/kendo.all.min.js")'></script>
<script src='@Url.Content("~/Contents/Scripts/kendo.aspnetmvc.min.js")'></script>
<script src='@Url.Content("~/Contents/Scripts/jquery.unobtrusive-ajax.js")'></script>
@Scripts.Render("~/bundles/administrator")
<script type="text/javascript">
$(document).ready(function () {
initiate('@ViewBag.ErrMessage');
});
</script>
}
<fieldset class="reportContent">
@using (Ajax.BeginForm("SearchUserByEmail", new AjaxOptions { UpdateTargetId = "foundUser" }))
{
<label> A user can only be added if they have registered with Orissa as a user. New users can register <a>here</a></label><br/>
<label>Email:</label>
<input type="text" name="email" />
<button id="btnSearch" class="k-button submit" value="Search">
<img src='@Url.Content("~/Contents/Images/search_icon.bmp")' height="20" width="20" />
</button>
<label style="color:red">@ViewBag.UserNotFound</label>
}
<div id="foundUser">
@Html.Partial("_FoundUser")
</div>
<div id="accountUsers"> <============================= This is the partial view
@Html.Partial("_AccountUsers")
</div>
</fieldset>
When I add a new row then immediately delete it, i get a new page opened with json data. If i delete an already existing (old) record it deletes fine, what am i doing wrong?
The remove-filter button [X] is being partially superimposed upon the filter icon in IE11, Chrome, and Opera (I haven't tested other browsers). See attached screen shot.
I'm referencing kendo.common.min.cs and kendo.default.min.cs -- is there another stylesheet that must be referenced as well?
Thanks

Hi,
I am really new to the Kendo UI Controls and thinking to integrate it in my web application.
The issue I am facing is binding the Treeview with the HTML tags as my dataTextField.
My controller is returning me List of strings, which I use for binding as JSON data to my VIEW.
The list of string contains string as below
"<span id='spn1' style=' font-weight: bold;'>text1</span> <a href='someFunction()'>text2</a> text3"
So, my Tree-node should display me output as :
text1 text2 text3
Instead of this, it displays my tree as-is with HTML tags. like above string.
So, What really concern is, is it possible to achieve my target? And if yes, What is the solution on this?
Hi there,
I have a page with multiple Kendo dropdownlists on it, working fine. However, I want each to have the selected value set based on a session value. I have approached this in 2 ways :-
a) Return a JSON-ed list of items, with the appropriate one marked as selected, and then bind the .Value property to the selected value
b) Use JS after the list is ready to set the selected item
I can't get either to work. My code is below, please assist.
Thanks, Mark
MVC VIEW CSHTML :-
@( Html.Kendo().DropDownList()
.Name("compliances")
.DataTextField("Text")
.DataValueField("Value")
.Filter("contains")
.Value("Selected")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("PopulateComplianceFilter", "Site");
})
.ServerFiltering(false);
})
.Events(e =>
{
e.Change("ComplianceChange");
})
)
CONTROLLER C# CODE :-
// Populate compliances on filter panel
public ActionResult PopulateComplianceFilter([DataSourceRequest]DataSourceRequest request)
{
List<Compliance> col = Enum.GetValues(typeof(Compliance)).Cast<Compliance>().ToList();
Array values = Enum.GetValues(typeof(Compliance));
List<ListItem> items = new List<ListItem>(values.Length);
// convert enum list to select item list to get values displayed on front end
foreach (Enum i in values)
{
items.Add(new ListItem
{
Text = EnumHelper.GetDisplayName(i),
Value = ((int)(Compliance)i).ToString(),
Selected = (((int)(Compliance)i) == sessionHelper.SiteFilter_ComplianceID)?true:false
});
}
return Json(items, JsonRequestBehavior.AllowGet);
}
I have a <div> that is bound to an MVVM View Model. Inside the <div> I have a Kendo Grid. I can't use the normal "data-" attributes because the column template syntax combined with razor syntax just does not mix. So, I'm trying to create the grid using the $('#grid').kendoGrid(); syntax.
My problem is that I don't see anyway to bind the dataSource of the grid to my dataSource inside the View Model. Is this possible?
Hi,
I have Grid with DropDown list. DropDown list has attributes filter and group. After selecting some value in DropDown list, attribute "group" causes "undefined". Here is my code:
...... kendoGrid({
dataSource: {
data: data.obmedzenia,
schema: {
model: {
fields: {
obmedzenie: {
defaultValue: {
nazov: "(§ 51 ods. 3 pÃsm)",
kod: "51O3A"
}
}
}
}
}
},
sortable: false,
filterable: false,
<c:if test="${editT_readF}">
editable: {
confirmation: false
},
toolbar: [{name: "create", text: "<spring:message code='button.create'/>"}],
</c:if>
columns: [
{
field: "obmedzenie",
title: "<spring:message code='opatrenia'/>",
template: "#=obmedzenie.nazov#",
editor: zoznamDropDownEditor
},
{
field: "poznamka",
title: "<spring:message code='poznamka'/>"
},
<c:if test="${editT_readF}">
{command: "destroy", title: " ", width: "135px"}
</c:if>
]});
function zoznamDropDownEditor(container, options) {
$('<input data-text-field="nazov" data-value-field="kod" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
dataSource: {
transport: {
read: {
url: "<c:url value="/api/pripad/zoznam/obmedzeni" />",
serverFiltering: true,
cache: false
}
},group: { field: "nazovSkupiny" }
},
filter: "contains",
dataTextField: "nazov",
dataValueField: "kod"
});
}
I forgot something? An attribute?
Thank you.