Hi,
I'm trying to refresh tooltip in grid but it's not working. Here's what I'm doing:
I have an MVC Grid and I initialize the tooltip like this:
var tooltip = $("#classesAvailableGrid").kendoTooltip({
filter: ".comment",
position: "top",
width: 180,
content: function (e) {
var dataItem = $('#classesAvailableGrid').data('kendoGrid').dataItem(e.target.closest('tr'));
var id = dataItem["Id"];
var text = $('#com-' + id).data('tooltiptext');
return text;
}
}).data("tooltiptext");
This works fine.
The functionality I'm seeking is when I click the cell where I have the tooltip I prompt the user with a popup input field where he can update the tooltip message. On success I save the new message to database but then I want to update the tooltip as well. I am able to update the data attribute but the actual message that is displayed on hover is still the same.
var request = $.ajax({
url: '/Controller/ActionMethod',
type: 'POST',
data: JSON.stringify(msg),
contentType: 'application/json; charset=utf-8'
}).success(function (data) {
if (0 >= data.error.length) {
if (data.icon) {
if (el.find('i').length) {
el.find('i').attr('data-tooltiptext', inputValue);
/*console.log(selectedTooltip);
selectedTooltip.tooltip.options.content = inputValue;
selectedTooltip.tooltip.refresh();*/
//$("#classesAvailableGrid").data('tooltiptext').refresh();
}
else {
var i = '<i id="com-' + el.data('rid') + '" class="fa fa-comment comment" data-tooltiptext="' + inputValue + '" aria-hidden="true"></i>';
el.find('div').append(i);
}
}
else {
el.find('div').empty();
}
swal({
title: data.title,
text: data.success,
type: "success",
timer: 1000,
});
}
else {
swal(data.title, data.error, "error");
}
}).error(function (data) {
});
I have tried several things but none have worked. Any help would be appreciated!
Thank you,
Jokull