I'm trying to create a treeview as result of a json request, but the treeview does not loads the images.
Assuming that:
data=[{"Id":"G_3","PId":"","Name":"test","HasChild":false,"IsExpanded":false,"IsGroup":true, "Order":0,"imageUrl":"/content/img/folder.png"}]
$.post(mViewPage.baseUrl + '/treeview/mapview/' + cod).done(function (data) {
$("#mtreeview").ejTreeView({
showCheckbox: true,
fields: {
id: "Id", parentId: "PId", text: "Name", hasChild: "HasChild", dataSource: data, imageUrl: "imageUrl"
}
});
});
Everything seems to work until certain point, the images are even downloaded from the server.
I've traced the problem to the following code in ej.treeview.js, when the _updateElement is called the node (liElement) has as innerHtml somthing like: <img src.../><a rel='nofollow' href="..." >test</a>
But as you can see in the below code this is remove in the first if...else...
_updateElement: function (liElement, subItem) {
var outerdiv, exCollpasediv, linkElement, spanTag ;
if (liElement.firstChild.nodeName == 'SPAN') {
spanTag = liElement.firstChild;
linkElement = liElement.lastChild;
}
else
linkElement = liElement.lastChild; //it's removed here
Is this some sort of bug or am I missing something?
Thanks