How to include popover in template

0 Answers 145 Views
OrgChart
Michael
Top achievements
Rank 1
Michael asked on 02 Nov 2021, 11:52 AM

Hello, I'm using the orgchart control for .net core MVC (Telerik: 2021.3.914), and I have a custom template for each node. It works perfectly, but I want to add a kendo popover on an icon. How do I go about using a popover within the template? The icon id and body would be dynamic, so I'm not sure how to get that working. I have a field named StatusTypeName that I have defined on the orgchart control, that I want to use as the body.

<script id="tmpDetails" type="text/kendo-tmpl">        
    <ul class="list-group">
        <li class="list-group-item bg-alpha text-white-50 px-3">
            <div class="form-row">
                <div class="col-md-1">
                    <i id="iStatus_#:id#" class="fa fa-circle align-self-center mr-2
                    #if (data.StatusTypeID == 1){#status-paused#}#
                    #if (data.StatusTypeID == 2){#status-started#}#
                    #if (data.StatusTypeID == 3){#status-cancelled#}#
                    #if (data.StatusTypeID == 4){#status-completed#}#
                    " style="padding-top: 1px;"></i>
                    @(Html.Kendo().Popover()
                        .For(???)
                        .Position(PopoverPosition.Top)
                        .ToggleOnClick(true)
                        .Body(#:StatusTypeName#)
                        .ToClientTemplate()
                    )
                </div> 

Michael
Top achievements
Rank 1
commented on 02 Nov 2021, 12:25 PM

Ooops, it was a simple fix. Please disregard.

@(Html.Kendo().Popover()
	.For("\\\\\\#iStatus_#:ID#")
	.Position(PopoverPosition.Top)
	.ToggleOnClick(true)
	.Body("<small>#:StatusTypeName#<small>")
	.ToClientTemplate()
)

No answers yet. Maybe you can help?

Tags
OrgChart
Asked by
Michael
Top achievements
Rank 1
Share this question
or