I'm using the tooltip for validation purposes. I create tooltips when a form fails validation by hooking into jQuery validation.
Because it's for validation, I don't want the tooltips to disappear when the user clicks away from the input.
e.g. I have an input text box which has invalid data, and so I show the tooltip next to the input. When the user clicks away from the input, the tooltip is hidden. I want it to permanently stay shown.
I've tried overriding the hide() method with no success.
Code below:
$.validator.setDefaults({
showErrors: function (errorMap, errorList) {
$.each(this.validElements(), function (index, element) {
var tooltip = $(element).data("kendoTooltip");
if (tooltip) {
tooltip.destroy();
}
});
$.each(this.invalidElements(), function (index, element) {
var tooltip = $(element).data("kendoTooltip");
if (tooltip) {
tooltip.destroy();
}
});
$.each(errorList, function (index, error) {
var element = $(error.element);
element.addClass("input-validation-error");
var tooltip = element.kendoTooltip({
content: error.message,
hide: function() {} //! THIS DOESN'T OVERRIDE!
}).data("kendoTooltip");
tooltip.show(element);
});
}
});
Because it's for validation, I don't want the tooltips to disappear when the user clicks away from the input.
e.g. I have an input text box which has invalid data, and so I show the tooltip next to the input. When the user clicks away from the input, the tooltip is hidden. I want it to permanently stay shown.
I've tried overriding the hide() method with no success.
Code below:
$.validator.setDefaults({
showErrors: function (errorMap, errorList) {
$.each(this.validElements(), function (index, element) {
var tooltip = $(element).data("kendoTooltip");
if (tooltip) {
tooltip.destroy();
}
});
$.each(this.invalidElements(), function (index, element) {
var tooltip = $(element).data("kendoTooltip");
if (tooltip) {
tooltip.destroy();
}
});
$.each(errorList, function (index, error) {
var element = $(error.element);
element.addClass("input-validation-error");
var tooltip = element.kendoTooltip({
content: error.message,
hide: function() {} //! THIS DOESN'T OVERRIDE!
}).data("kendoTooltip");
tooltip.show(element);
});
}
});