如何在 Extjs 网格标题菜单上添加额外按钮

发布于 2024-10-08 18:27:43 字数 120 浏览 0 评论 0原文

有人需要在网格面板标题菜单(排序\列)中添加一个额外的按钮吗? 我可能想在菜单中添加另一个按钮来重置为默认列模型。我可以使用 Jquery 来完成此操作,但我想知道是否有 EXTjs 方法可以做到这一点。

谢谢

has anybody had the need to add an extra button to the grid panel header menu(sorting\columns)?
potentially I would like to add another button to the menu that resets to the default columns model. I can accomplish this using Jquery but I was wondering if there is an EXTjs way to do it.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纸短情长 2024-10-15 18:27:43

您需要深入研究源代码才能看到它的存在,但是 GridPanel 有一个 view 属性,即它的 GridView ,而 GridView 又具有 < code>hmenu 属性,这是当您单击这些列标题之一时显示的菜单。

因此,使用名为 gridpanelGridPanel(一旦呈现),您可以执行以下操作:

gridpanel.view.hmenu.add({
  text: 'reset',
  handler: function() {
    // reset magicks
  }
});

You need to dig through the source to see it's there, but a GridPanel has a view property which is its GridView which in turn has a hmenu property which is the menu it shows when you click on one of those column headers.

So, with a GridPanel called gridpanel (once it's rendered) you can do the following:

gridpanel.view.hmenu.add({
  text: 'reset',
  handler: function() {
    // reset magicks
  }
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文