Mouhssine tahri

Mouhssine tahri

  • NA
  • 201
  • 9.8k

use multiple plugin type in treeview

May 27 2021 1:55 PM
hello
 
i want use multiple type in treeview
 
<div id="jstree">
@(Html.TreeView(Model)
.EmptyContent("TelepacTechnology.")
.Children(m => m.childs)
.HtmlAttributes(new { id = "tree" })
.ChildrenHtmlAttributes(new { @class = "subItem" })
.ItemText(m => m.Libelle)
.ItemTemplate(
@<text>
@if (@item.Cat == 0)
{
<a href="@item.Libelle" data-toggle="" data-target="" data-jstree='{"icon":"glyphicon glyphicon-leaf"}' desc="@item.Libelle" onclick="Affiche_Entite_row( ' @item.Code ' );">@item.TNiveau.LibelleNiv @item.Libelle </a>
}
else
{
<a href="@item.Libelle" data-toggle="" data-target="" data-jstree='{ "type" : "poste" }' "s" : "tree" desc="@item.Libelle" onclick="Affiche_Poste_row( ' @item.Code ' );">@item.Code @item.Intitule @item.Responsable </a>
}
/**/
/**/
/**/
/**/
</text>)
)
</div>
"types": {
"default": { "icon": "fa fa-sitemap" },
"fax": { "icon": "fa fa-sitemap" },
"poste": { "icon": "fa fa-phone" }
},
 
if (@item.Cat == 0) i want use type fax
else i want use type poste
thanks

Answers (7)