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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Tile & Tree View template rendering problem

Thread ID:

Created:

Updated:

Platform:

Replies:

120098 Aug 31,2015 06:13 AM UTC Sep 1,2015 09:56 AM UTC ASP.NET MVC 1
loading
Tags: TreeView
Ferry To
Asked On August 31, 2015 06:13 AM UTC

For Tiles, there is sample templates shown in the documentation as below:

<div id="tile"></div>
    <div id="imageTemplate">
        <div id="appimage">
        </div>
        <div class="tileMargin">
            <span class="caption">Google Search</span><br />
            <span class="description">The world’s information</span><br />
            <span class="sub">Free</span>
        </div>
    </div>
    <div id="captionTemplate" class="title">Windows Store</div>
However the documentation didn't tell how could we insert the values into the template, say we would like to replace "Google Search" with Id iterate from our model, can we have a sample on how to do that?
For Tree View, we have the following code:

<script id="treeTemplate" type="text/x-jsrender">

    {{if HasChild}}

    <div class={{>Name}} -style>{{>Name}}</div>

    {{else}}

    <div class="cont-list">

        <div class="cont-details">

            <span>{{>Name}}</span>

            <span>{{>Count}}</span>

        </div>

        <div class="cont-del"></div>

        <div class="treeFooter"></div>

    </div>

    {{/if}}

</script>

@(Html.EJ().TreeView("tree").Template("#treeTemplate").LoadOnDemand(true)

    .ClientSideEvents(e => e.NodeSelect("onTreeNodeSelect"))

    .ClientSideEvents(e => e.BeforeExpand("onBeforeExpand"))

    .TreeViewFields(f => f.Datasource(Model).Id("Id").ParentId("Pid").Text("Name").Expanded("Expanded").HasChild("HasChild"))

)

But the tree rendered the same as without specify the Template("#treeTemplate") attribute, are we missed something?

Harikrishnan P [Syncfusion]
Replied On September 1, 2015 09:56 AM UTC

Hi Ferry,

Thanks for contacting Syncfusion support.

Query: However the documentation didn't tell how could we insert the values into the template, say we would like to replace "Google Search" with Id iterate from our model, can we have a sample on how to do that?

We have prepared a sample based on your requirement, could you please check with the sample in the following location?

Sample Location: Tile and TreeView sample

In the above sample we have used ViewModel to pass the data to view page and iterate the values in the Model to specify the values for the Tile Template. Please check with it and let us if it helps to achieve your requirement.

Query 2: But the tree rendered the same as without specify the Template ("#treeTemplate") attribute, are we missed something?

We are unable to reproduce the above reported issue. Could you please check with the above attached sample? We suspect that you have not included the “Template” property. We need to include this property and pass the “id” of the template as the value for this property.
If still you face any difficulties, kindly revert back the provided sample based on your application along with the replication procedure to reproduce the issue at our end. This would be more helpful for us to provide a solution at the earliest.

To know about the list of properties, methods and events supported by any JS component, go to the online help link for JS (http://helpjs.syncfusion.com/js/overview) and click on the “API reference” section and navigate to the particular component. For example, to know all the available options in DatePicker check the following link,
 
http://helpjs.syncfusion.com/js/api/ejdatepicker

For getting started and to know about the important features in any particular component, go to the help link and click on the particular component. For example, getting started and key features in DatePicker can be found in

http://helpjs.syncfusion.com/js/datepicker/overview

Please let us know if you have further queries.

Regards,
HariKrishnan  

CONFIRMATION

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.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;