我正在使用Kendo UI创建一个网格视图,该视图将数据库中的模型数据作为列表加载。我想知道如何通过公司ID过滤数据。
这是我的代码:
@model List<FirmsModel>
<script type="text/javascript">
$(document).ready(function () {
$("#grid").kendoGrid({
sortable: true,
pageable: true,
dataSource: { pageSize: 20 }
});
});
</script>
<div class="view">
<table id="grid">
<thead>
<tr>
<th data-field="FirmID">
Firm ID
</th>
<th data-field="subjectTitle">
Subject Title
</th>
<th data-sortable="false">
Delete
</th>
</tr>
</thead>
<tbody>
@foreach (var i in Model)
{
<tr>
<td>@i.firm_id
</td>
<td>@i.subject_title
</td>
<td>@Html.ActionLink("Delete", "")
</td>
</tr>
}
</tbody>
</table>
</div>
答案 0 :(得分:0)
试试这个,
<script type="text/javascript">
$(document).ready(function () {
$("#grid").kendoGrid({
sortable: true,
pageable: true,
filterable:
{
mode: "row"
},
dataSource: { pageSize: 20 }
});
});
</script>