【发布时间】:2016-04-15 04:29:56
【问题描述】:
我正在运行一个使用剑道网格行模板的项目。 下面是我的 html 网格代码:
table id="grid" style="width:100%">
<colgroup>
<col class="photo" />
<col class="details" />
<col />
</colgroup>
<thead style="display:none">
<tr>
<th>
Details
</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="3"></td>
</tr>
</tbody>
</table>
<script id="rowTemplate" type="text/x-kendo-tmpl">
<tr>
<td style="width:30%">
div class="row">
<div id="dvImage" class="col-sm-4" style="width:118px">
#= imagelink #
</div>
<div class="col-sm-8" style="width:400px">
<span class="name" style="font-size:14px; color:green">#: Link #</span>
</div>
</div>
</td>
</tr>
</script>
在上面的 div 类名“dvImage”脚本中,有时数据不存在,所以它仍然包含那些空间。
我用谷歌搜索了很多东西并知道如果我们可以在 onDataBound 事件中找到这个 div 类,那么我可以检查这个 div 是否没有数据,然后可以隐藏这个 div 的特定行。但是当我只为第一行尝试这个时,我能够隐藏其他行的数据,但它仍然包含空间。 欢迎所有建议。
【问题讨论】:
标签: kendo-grid