jQuery 用于 ASP.NET MVC 的网格控件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/177275/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 08:44:51  来源:igfitidea点击:

grid controls for ASP.NET MVC?

jqueryasp.net-mvcgrid

提问by MikeJ

If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere?

如果您使用的是 ASP.NET MVC,您如何进行网格显示?自己卷的?有图书馆吗?

These are some of the known grid display solutions I have found for ASP.NET MVC

这些是我为 ASP.NET MVC 找到的一些已知的网格显示解决方案

If you know of anything else that you are using or know to be good, please let me know.

如果您知道您正在使用的其他任何东西或知道它是好的,请告诉我。

采纳答案by Sean Carpenter

We have been using jqGridon a project and have had some good luck with it. Lots of options for inline editing, etc. If that stuff isn't necessary, then we've just used a plain foreach loop like @Hrvoje.

我们一直在一个项目中使用jqGrid并取得了一些好运。内联编辑等的很多选项。如果这些东西不是必需的,那么我们只是使用了像@Hrvoje 这样的普通 foreach 循环。

回答by Sam Saffron

We use Slick Gridin Stack Exchange Data Explorer (example containing 2000 rows).

我们在 Stack Exchange Data Explorer 中使用Slick Grid示例包含 2000 行)。

I found it outperforms jqGridand flexigrid. It has a very complete feature set and I could not recommend it enough.

我发现它优于jqGridflexigrid。它有一个非常完整的功能集,我不能推荐它。

Samples of its usage are here.

其用法示例在此处

You can see source samples on how it is integrated to an ASP.NET MVC app here: https://code.google.com/p/stack-exchange-data-explorer/

您可以在此处查看有关如何将其集成到 ASP.NET MVC 应用程序的源示例:https: //code.google.com/p/stack-exchange-data-explorer/

回答by berko

We have just rolled our own due to limited functionality requirements on our grids. We use some JQuery here and there for some niceties like pagination and that is all we really need.

由于我们网格的功能要求有限,我们刚刚推出了自己的。我们在这里和那里使用一些 JQuery 来实现一些细节,比如分页,这就是我们真正需要的。

If you need something a little more fully featured you could check out ExtJs grids here.

如果您需要更全面的功能,您可以在此处查看 ExtJs 网格。

Also MvcContrib has a grid implementation that you could check out - try here. Or more specifically here.

此外 MvcContrib 有一个网格实现,您可以查看 -在此处尝试。或者更具体地说在这里

回答by Dejan Milicic

I just discovered Telerik has some great components, including Grid, and they are open source too. http://demos.telerik.com/aspnet-mvc/

我刚刚发现 Telerik 有一些很棒的组件,包括 Grid,而且它们也是开源的。 http://demos.telerik.com/aspnet-mvc/

回答by Hrvoje Hudo

If it's just for viewing data, I use simple foreach or even aspRepeater. For editing I build specialized views and actions. Didn't like webforms GridView inline edit capabilities anyway, this is kinda much clearer and better - one view for viewing and another for edit/new.

如果只是为了查看数据,我使用简单的 foreach 甚至 aspRepeater。对于编辑,我构建了专门的视图和操作。反正不喜欢 webforms GridView 内联编辑功能,这更清晰更好 - 一个视图用于查看,另一个用于编辑/新建。

回答by Manuel Castro

jqGrid is $299 if you use a special version that has server side integration, but it really is not that difficult to use the open source free version with ASP.NET MVC, once you get your jquery configuration straight it's almost as simple to use as any other licensed grid:

如果您使用具有服务器端集成的特殊版本,jqGrid 为 299 美元,但在 ASP.NET MVC 中使用开源免费版本确实不是那么困难,一旦您直接获得 jquery 配置,它几乎和任何使用一样简单其他许可电网:

http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx

http://haacked.com/archive/2009/04/14/using-jquery-grid-with-asp.net-mvc.aspx

回答by Francesco Abbruzzese

You can use also the Insert/update/delete datagrid of my MVC Controls Toolkit available here on codeplex: http://mvccontrolstoolkit.codeplex.com/. Hereyou can download a complete example, herethe datagrid working and hereand heretutorials. The DataGrid works completely client side and mantains thechange set between posts. Yes it mantains Changeset, this means, you can access both old version and modified version of each record to see what changes to pass to the DB(what need to be modified deleted or inserted). This Changeset is mantained after several posts till you either confirm or cancel the modifications on the server side.

您还可以使用我的 MVC 控件工具包的插入/更新/删除数据网格,可在 codeplex 上找到:http://mvccontrolstoolkit.codeplex.com/ 。在这里你可以下载一个完整的例子,这里是数据网格工作,这里这里教程。DataGrid 完全在客户端工作并维护帖子之间的更改集。是的,它包含变更集,这意味着,您可以访问每条记录的旧版本和修改版本,以查看要传递给数据库的更改(需要修改删除或插入的内容)。此变更集在多次发布后维护,直到您在服务器端确认或取消修改。

回答by Mark Kadlec

If it is read-only a good idea would be to create a table, then apply some really easy-but-powerful JQuery to that.

如果它是只读的,一个好主意是创建一个表,然后应用一些非常简单但功能强大的 JQuery。

For simple alternative colour, try thissimple JQuery.

对于简单的替代颜色,试试这个简单的 JQuery。

If you need sorting, this JQuery plug-insimply rocks.

如果您需要排序,这个 JQuery 插件简直就是摇摆不定

回答by MvcSurfer

I tried the example hereof the Mvc Controls Toolkit grid. It appears a quite powerful and easy to use grid. The tutorial not only explain how to use the grid but also how to do paging, organize a view model and data annotations. It is worth to read it.

我在这里尝试了Mvc Controls Toolkit 网格的示例。它看起来是一个非常强大且易于使用的网格。本教程不仅解释了如何使用网格,还解释了如何进行分页、组织视图模型和数据注释。值得一读。