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

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

本文介绍了如何在Extjs网格标题菜单上添加额外按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人需要在网格面板标题菜单中添加一个额外的按钮(sorted \columns)?
潜在的我想添加另一个按钮到菜单,重置为默认的列模型。我可以用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

推荐答案

你需要挖掘源代码才能看到它,但是 code>属性,这是它的 GridView ,它又有一个 hmenu 属性,它是它在什么时候显示的菜单你点击其中一个列标题。

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.

因此,使用 GridPanel 调用 gridpanel (一旦呈现),您可以执行以下操作:

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
  }
});

这篇关于如何在Extjs网格标题菜单上添加额外按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 04:10