-1
我有一些語法問題,在我的劍道網格模板劍道行的模板語法(從HTML表綁定)
我有一個表
<table class="table table-bordered table-striped " id="MapDetails">
<thead>
<tr class="">
<th data-field="firstname">First Name</th>
<th data-field="surname">Surname</th>
<th data-field="class">Class</th>
<th data-field="age">Current Age</th>
@{
foreach (MapDetail geMapDetailHead in Model.mapDetails)
{
....
<th></th>
}
}
</thead>
<tbody>
</tbody>
</table>
<script id="gridtemplate" type="text/x-kendo-template">
<tr>
<td>
#= firstname #
</td>
<td>
#= surname #
</td>
<td>
#= birthdate #
</td>
<td>
#= classname #
</td>
</tr>
現在我綁定表劍道電網而像這樣定義
$("#MapDetails")
.kendoGrid(
{
sortable: true,
dataSource: {
data:values,
pageSize: 2
},
pageable: true,
resizable: false,
columnMenu: true,
scrollable:true,
navigatable: true,
editable: "incell",
rowTemplate: kendo.template($("#gridtemplate").html())
});
一排模板能正常工作,但gridtemplate內,我現在NE編輯做一些事情如下
<script id="gridtemplate" type="text/x-kendo-template">
<tr>
<td>
#= firstname #
</td>
<td>
#= surname #
</td>
<td>
#= birthdate #
</td>
<td>
#= classname #
</td>
#=foreach(var r in results)
{
//if r.assessmentid == assessment in header (mapdetails)
<td>r.resultvalue</td>
else
<td></td>
}
#
</tr>
,什麼是問題? – Sandman
這工作正常,但在gridtemplate,我現在需要做的事情如下...其中有一些語法錯誤 – Samra