This is a migrated thread and some comments may be shown as answers.

Grid Invalid detail template

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ICT
Top achievements
Rank 1
ICT asked on 17 Oct 2013, 12:03 PM
Hi Telerik Team,
I've have grid using external detail template. This is explained in web demos  in here http://demos.kendoui.com/web/grid/detailtemplate.html

I'm trying to do exactly same functionality with Java Server Pages. Here is my JSTL code:
<script type="text/x-kendo-template" id="${attribute.name}-template">
<div class="${attribute.name}-tabstrip">
    <ul>
    <c:forEach var="attributeGroup" items="${mlib:attributeGroupSortByName(attribute.definition.templateObject.attributeGroups)}" varStatus="stat">
        <li <c:if test="${stat.index == 0}">class="k-state-active"</c:if>>${attributeGroup.name}</li>
    </c:forEach>
    </ul>
 
    <c:forEach var="ag" items="${attribute.definition.templateObject.attributeGroups}">
    <div>
    <ul>
        <c:forEach var="attribute" items="${mlib:sortAttributesByOrder(ag.attributes)}">
            <li><label>${attribute.definition.desc.text}:</label>#= ${attribute.name} #</li>
        </c:forEach>
    </ul>
    </div>
    </c:forEach>
</div>
</script>
And my JS looks like this:
detailTemplate: kendo.template($("#class_refs-template").html()),
detailInit: function( e ) {
    var detailRow = e.detailRow;
    detailRow.find(".class_refs-tabstrip").kendoTabStrip({
        animation: {
            open: {
                effects: "fadeIn"
            }
        }
    });
}

My html looks like this:
<div class="class_refs-tabstrip">
<ul>
    <li class="k-state-active">Header Description</li>
    <li >Others</li>
    <li >system</li>
</ul>
 
<div>
<ul>
   <li><label>Description:</label> #= foo# </li>
     <li><label>Description:</label> #= bar# </li>
         <li><label>Description:</label> #= foo# </li>
     <li><label>Description:</label> #= foo# </li>
     <li><label>Description:</label> #= foo# </li>
     <li><label>Description:</label> #= foo# </li>
     <li><label>Description:</label> #= bar# </li>
     <li><label>Description:</label> #= foo# </li> 
</ul>
</div>
...
I cant figure out what is happening here? If I remove #= ${attribute.name} # from my JSTL then template is workin but values are not binded to placeholders.

1 Answer, 1 is accepted

Sort by
0
Accepted
ICT
Top achievements
Rank 1
answered on 17 Oct 2013, 12:29 PM
I figured this out now. My server response was empty array on this. :)
Tags
Grid
Asked by
ICT
Top achievements
Rank 1
Answers by
ICT
Top achievements
Rank 1
Share this question
or