Hi there,
I am trying to add dynamic tooltip to treemap by using ajax function. Tooltip contents are synamic based on id of treemap element. So i decided to use ajax function in content of tooltip, Ajax will call to controller and return "Text" string content. When i wrote below to achieve this tooltip is blank without any content. I think i did some syntax error. Sorry i could not able to find relevant example also.
Code (View)
$("#treeMap").kendoTooltip({
filter: ".k-leaf,.k-treemap-title",
content: function (e) {
var treemap = $("#treeMap").data("kendoTreeMap");
var item = treemap.dataItem(e.target.closest(".k-treemap-tile"));
//return item.ParameterID + ": " + item.ParameterName + ": " + item.tooltip;
var parameterID = item.ParameterID;
$.ajax({
url: '@Url.Action("GetTooltipData", "Analysis")' + '?ID=' + parameterID,
success: function (data) {
//return data;
return "hi, this is test tooltip";
},
error: function (msg) {
toastr.error("Error: " + msg.statusText);
}
});
}
});
Thank you in advance for your support