我已经下载了flexigrid,并将解压后的文件夹(flexigrid-1.1)复制到我的mvc3根目录下。
然后在我的视图中添加了以下内容:
<script src="@Url.Content("~/flexigrid-1.1/js/flexigrid.js")" type="text/javascript"></script>
<link rel="Stylesheet" type="text/css" href="../../flexigrid-1.1/css/flexigrid.css" />这段代码:
<script type="text/javascript">
$(function () {
$(".flexme").flexigrid();
});
</script>这张桌子
<table class="flexme">
<thead>
<tr>
<th>Number</th>
<th>Kind</th>
</tr>
</thead>
<tbody>
@if (Model.Phones.Count > 0)
{
foreach (var phone in Model.Phones)
{
<tr>
<td>
@Html.DisplayTextFor(i => phone.Number);
</td>
<td>
@Html.DisplayTextFor(i => phone.Type);
</td>
</tr>
}
}
</tbody>
</table>但是什么也没发生,据我所知,它会找到.flexigrid()方法并调用它。我对所有这些jquery东西都是新手,所以我不知道去哪里找我的问题。
发布于 2012-02-15 23:11:01
实际上,Flexigrid不是这样工作的。
有两种处理数据的方法:
将plug-in.
检查此Flexigrid & Jquery on a MVC3 view with EF4 example。
https://stackoverflow.com/questions/9293580
复制相似问题