MVC3 可编辑网格
我需要在我的 MVC3 项目中使用可编辑网格。 (即,网格需要添加行、删除行、编辑每行内的单元格)。我尝试过 Telerik,但文档似乎主要是 MVC2,我发现它很难理解。有谁知道一个像样的 MVC2 Edittable 网格吗?
I have a requirement to use an editable grid in my MVC3 project. (i.e., the grid needs to add rows, delete rows, edit cells within each row). I've tried Telerik but the documentation seems to be primarily MVC2 and I found it difficult to understand. Does anyone know of a decent MVC2 Edittable grid?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与其寻找“MVC 网格”,您可能会更幸运地搜索适合您需求的 JQuery(或其他 javascript 网格)。您会发现大多数 MVC 网格只是将 jquery 网格包装在帮助程序类中,以使 .NET 开发人员更方便。 这里是一些漂亮的 JQuery 网格的示例。我个人使用过 Flexigrid 并且(虽然文档很少)它非常容易使用
Rather than looking for an "MVC Grid" you'd probably have more luck searching for a JQuery (or other javascript grid) that fits your needs. Most MVC grids you will find are merely wrapping a jquery grid in a helper class to make things more convenient for .NET developers. Here are some examples of nice JQuery grids. I've personally used Flexigrid and (while documentation is sparse) it is pretty easy to use
看看knockout可编辑集合示例,它也可能会给你一些想法:
http://knockoutjs.com/ example/gridEditor.html
仅在客户端,您只需将 JSON 序列化回服务器,它将自动由 ModelBinder 解释并反序列化到您的模型类中。这消除了在行插入、删除等操作之间必须返回服务器进行任何操作的情况。
Look at the knockout editable collection samples, it may give you some ideas as well:
http://knockoutjs.com/examples/gridEditor.html
Its client side only, and you can just serialize your JSON back to the server and it will automatically be interpreted by the ModelBinder and deserialized in to your model class. This eliminates having to go back to the server for anything between row inserts, deletes, etc.