Closed buttflattery closed 6 years ago
Try to configure it this way as shown below for rendering icons within the list
'iconEditSettings' => [
'show' => 'list',
'type' => TreeView::ICON_RAW,
'listData' => [
'widgets' => '<i class="material-icons">widgets</i> Root',
'folder' => '<i class="material-icons">folder</i> Sub Campaign'
]
],
However the above setting is only for rendering icons within the LIST data -
for rendering them as markup in the node - I will check back and update.
Hmm looks like the name=>value
pair has to go the other way around, I think the documentation should also be updated, i will be trying that now thanks for the heads up @kartik-v
Yes.. for rendering it in the list... However both values and keys can be same if rendering the node icon
Steps to reproduce the issue
TreeView
with the followingiconEditSettings
2.Open TreeView and add a new node 3.Select the desired icon and hit save
Expected behavior and actual behavior
It should show me the selected icon in the treeview before the node name
When I follow those steps, I see... There isn't any icon displayed in the treeview before the new node name and when inspected the html it shows the following HTML for the node inside the tree
You can see that in case of
ICON_RAW
it still tries to append it in theclass
attribute like thisclass="glyphicon glyphicon-<i class="material-icons">folder</i>">
I was expecting...
it should add the provided raw HTML as a separate tag instead of appending into the class name assuming it to be Font awesome icon class name as the docs say
Which means if i provide the same set of
name=>value
pair above provided in the docs it still papends theimg
tag inside theclass
attributeEnvironment
Yii 2.0.14.1
Browsers
Operating System
Libraries
Isolating the problem