Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149694 | Dec 5,2019 02:51 PM UTC | Dec 19,2019 12:02 PM UTC | Blazor | 8 |
![]() |
Tags: TreeView |
<TreeViewTemplates>
<NodeTemplate>
@{
var employee = ((context as EmployeeDetails));
<img id="@((@context as EmployeeDetails).EmployeeId)" class="eimage" src="@UriHelper.ToAbsoluteUri($"/{@employee.Image}.png")" @onclick="@((e) =>MemberFunction((@context as EmployeeDetails).EmployeeId, e))" />
<div class="ename">@((@context as EmployeeDetails).EmployeeName)</div>
<div class="ejob">@((@context as EmployeeDetails).Designation)</div>
}
</NodeTemplate>
</TreeViewTemplates> |
void MemberFunction(int args, MouseEventArgs args1)
{
// Set context menu item based on image id /*args- image id*/
if (args == 1)
{
menu.HideItems(this.RemoveItem);
menu.ShowItems(this.showItem);
}
else
{
menu.HideItems(this.showItem);
menu.ShowItems(this.RemoveItem);
}
//Open the context menu during click
menu.Open(args1.ClientY + 20, args1.ClientX + 10);
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.