MVCContrib Grid - 排序(GridSortOptions,前缀)不生成用于排序的链接
我尝试在同一页面中使用两个网格,并遵循我在这里找到的内容:
http://mvccontrib。 codeplex.com/workitem/7032
还有其他人遇到 Sort() 方法不生成链接的问题吗?
排序之前是有效的,但它以相同的方式对两个网格进行排序。我唯一改变的是按照上面页面的指示添加了 Bind 属性,并将前缀添加到了 Sort 调用中。
I'm trying to use two grids in the same page and following what I found here:
http://mvccontrib.codeplex.com/workitem/7032
Has anyone else had a problem with the Sort() method not generating links?
The sorting was working before but it was sorting both grids the same way. The only thing I have changed is added the Bind attributes as the page above instructs and added the prefix to the call to Sort.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,mvccontrib 网格代码检查 SortOptions 是否已填充以及该列是否可排序。如果为 false,则没有链接。
显然,BindAttribute 导致默认模型绑定器第一次不填充参数对象,在这种情况下意味着我的 GridSortOption 参数均为 null。
So the mvccontrib grid code checks if the SortOptions has been populated and if the column is sortable. If false, no links.
Apparently the BindAttribute causes the default model binder to NOT populate the paramter objects first time through which in this case meant my GridSortOption parameters were both null.