无法让 Flexigrid 在表格中工作
我已经下载了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 东西都很陌生,所以我不知道在哪里寻找我的问题。
I've downloaded flexigrid, and copied the unpacked folder (flexigrid-1.1) to my mvc3 root.
Then added the following to my view:
<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" />
This code:
<script type="text/javascript">
$(function () {
$(".flexme").flexigrid();
});
</script>
and the table
<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>
But nothing happens, as far as I can see, it finds the .flexigrid() metod, and calls it. I'm new to all this jquery-stuff, so I don't know where to look for my problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实上,Flexigrid 并不是这样工作的。
有两种处理数据的方法:
检查这个 Flexigrid & MVC3 视图上的 Jquery 和 EF4 示例。
Actually Flexigrid does not work that way.
There are two ways of processing your data:
Check this Flexigrid & Jquery on a MVC3 view with EF4 example.