Reputation: 4119
DropDownList:
@(Html.Kendo().DropDownList()
.Name("ddlRoles")
.OptionLabel("ACCOUNT TYPE")
.HtmlAttributes(new { @class = "ddlRoles" })
.BindTo((IEnumerable<SelectListItem>)ViewBag.ApplicationRoles)
)
ToolTip
@(Html.Kendo().Tooltip()
.For("#help-tooltip")
.Position(TooltipPosition.Top)
.Content("Hello")
)
The content "Hello" I want it to base it on the item selected on ddlRoles
Upvotes: 1
Views: 2534
Reputation: 4119
@(Html.Kendo().DropDownList()
.Name("ddlRoles")
.OptionLabel("ACCOUNT TYPE")
.HtmlAttributes(new { @class = "ddlRoles text-danger" })
.BindTo((IEnumerable<SelectListItem>)ViewBag.ApplicationRoles)
)
)
Then the Tooltip
@(Html.Kendo().Tooltip()
.For("#ddlRoles").
.Position(TooltipPosition.Top)
.Events(events => events.Show("onHoverShowToolTip"))
)
when the tooltip is shown, call a javascript function
function onHoverShowToolTip() {
loadToolTipContent();
}
function loadToolTipContent() {
//this call getToolTipContent();
$("#the name of the generated tooptip").data("kendoTooltip").options.content = getToolTipContent();
$("#the name of the generated tooptip").data("kendoTooltip").refresh();
}
function getToolTipContent() {
var role = selectedRole();
var result = "THE CONTENT THAT YOU WANT";
return result;
}
Upvotes: 1