We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

WebService Databind, doesn't display items

I have this treeview on a MVC view:
<script id="nodeTree" type="text/x-jsrender">
    <input type="hidden" id="{{>Id}}_idinstalacion" value="{{>IdInstalacion}}" name="idInstalacionItem" />
    {{if IsEquipo}}

    <div class="isequipo"></div>
    {{if IsParado}}
    <img name="wrenchImage" src="@(Url.Content("~/Content/images/icons-png/wrench-red.png"))" />
    {{else}}
    <img name="wrenchImage" src="@(Url.Content("~/Content/images/icons-png/wrench.png"))" />
    {{/if}}

    {{>Name}}


    {{else IsSubinstalacion}}

    <div class="isSubinstalacion"></div>
    {{>Name}}

    {{else}}

    {{>Name}}

    {{/if}}

</script>

@(Html.EJ().TreeView("treeInstalaciones")
        .TreeViewFields(d =>
            d.Datasource(ds => ds.URL(Url.Action("GetInstalacionesTreeView", "Home")))
                .Id("Id")
                .Text("Name")
                .ParentId("ParentId")
                .Expanded("Expanded")
                .HasChild("HasChild")
                .Query("ej.Query().addParams('idInstalacion','-1')")
        )
        .EnablePersistence(true)
        .Template("#nodeTree")
)

As you can see the treeview as bind to a webservice. Wich code is:
public JsonResult GetInstalacionesTreeView(int idInstalacion)
        {
            List<TreeEntry> arbolVM = new List<TreeEntry>();

            //Padre 1
            arbolVM.Add(new TreeEntry
            {
                Expanded = true,
                HasChild = true,
                Id = 1,
                IdInstalacion = 1,
                IsEquipo = false,
                IsParado = false,
                IsSubinstalacion = false,
                Name = "Padre"
            });

            //Hijo activo
            arbolVM.Add(new TreeEntry
            {
                Expanded = true,
                HasChild = true,
                Id = 2,
                IdInstalacion = 1,
                IsEquipo = true,
                IsParado = false,
                IsSubinstalacion = false,
                Name = "Activo",
                ParentId = 1
            });


            //Hijo parado
            arbolVM.Add(new TreeEntry
            {
                Expanded = true,
                HasChild = true,
                Id = 3,
                IdInstalacion = 1,
                IsEquipo = true,
                IsParado = true,
                IsSubinstalacion = false,
                Name = "Activo",
                ParentId = 1
            });


            //Hijo parado
            arbolVM.Add(new TreeEntry
            {
                Expanded = true,
                HasChild = true,
                Id = 4,
                IdInstalacion = 1,
                IsEquipo = true,
                IsParado = true,
                IsSubinstalacion = false,
                Name = "Activo",
                ParentId = 1
            });
            return Json(arbolVM, JsonRequestBehavior.AllowGet);
        }

However, when i open the view on the browser, it doesn't display any items. I have attached a sample where you can reproduce the problem


Attachment: Sample_18fe95b6.rar

1 Reply

MM Manikandan Mariappan Syncfusion Team April 8, 2016 11:59 AM UTC

Hi Jaime,
Thank you contacting Syncfusion support.
The reported issue is already a known issue in the reported version (13.2.0.39). We have fixed this issue and the fix is already included in our 13.3.0.7 version.
After that release we have implemented more number of functionality with ejTreeView component. So, please upgrade to our latest version to resolve your reported issue also to utilize our components with more usability features.
Our latest version Essential Studio 2016 Volume 1 (v14.1.0.41) is rolled out and is available for download under the following link:
http://www.syncfusion.com/forums/123633/essential-studio-2016-volume-1-release-v14-1-0-41-is-available-for-download
Regards,
Manikandan Mariappan

Loader.
Live Chat Icon For mobile
Up arrow icon