如何在 Ext.grid.GridPanel 中显示复选框?
我需要显示“Active”列的复选框,并且当我更改选择以便能够发出 ajax 请求时,以更新数据库。
一些示例代码会对我有很大帮助。
谢谢。
I need to display a checkbox for column "Active" and when I change the selection to be to able to make an ajax request, to update the database.
Some sample code will help me a lot.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请检查此链接:Extjs 网格插件。
您可以检查第二个网格的来源。
此外,您还需要监听网格选择模型的“selectionchange”事件 - 这样您就可以选择行,然后您可以向服务器或您需要的任何内容提交请求。
如果您需要特定列(不是第一个) - 您可以检查此链接:网格中的复选框
我认为这里也一样:如何将复选框列添加到 Extjs 网格
Please check this link: Extjs Grid plugins.
You can check sources for second grid.
Also you need listen 'selectionchange' event for selection model of the grid - so you'll have selected rows and then you can submit a request to server or whatever you need.
If you need specific column (not the first one) - you can check this link: Checkbox in the grid
And I think this is same here too: how to add checkbox column to Extjs Grid
这是我的一个项目的示例:
重要的部分是在 initComponent 中创建选择模型:
This is example from one of my projects:
The important part is that in the initComponent you create the selection model: