传递一个处理程序来过滤按钮属性 [英] Pass a handler to filter button property

查看:104
本文介绍了传递一个处理程序来过滤按钮属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个处理程序,当我右键单击它时,它将清除标准。我如何在setFilterButtonProperties中设置它?我希望能够右键单击过滤器按钮,它应该清除我输入到过滤器字段中的所有字符。

  addFilterEditorSubmitHandler(新的FilterEditorSubmitHandler()
{

@Override
public void onFilterEditorSubmit(FilterEditorSubmitEvent event)
{
if(event.isRightButtonDown())
{
SC.warn(right clicked);
clearCriteria();

}
}

});

setFilterButtonProperties();


解决方案

保持功能独立。在同一个按钮上混合两个不同任务没有意义。从最终用户的角度考虑。



不要使用右键点击按钮,因为这不是常见做法。最终用户如何知道新功能,除非悬停可见?根据图标

,创建一个单独的按钮,唯一的目的是清除应用的过滤器。您可以在页眉/页脚中添加该按钮,如中所示智能GWT展示

要清除已经应用的过滤器,只需调用 ListGrid#fetchData()不经过任何标准都意味着点击新按钮 null


So I have a handler for when I right click it , it will clear the criteria. How do I set this in setFilterButtonProperties? I want to be able to right click the filter button, it should clear all the characters I typed into the filter fields.

        addFilterEditorSubmitHandler(new FilterEditorSubmitHandler()
        {

            @Override
            public void onFilterEditorSubmit(FilterEditorSubmitEvent event)
            {
                if (event.isRightButtonDown())
                {
                    SC.warn("right clicked");
                    clearCriteria();

                }
            }

        });

setFilterButtonProperties();

解决方案

Keep the functionality separate. There is no meaning of mixing two different tasks on the same button. Think from the end user's perspective.

Don't use right click of the button because that's not common practice. How come the end user know about the new functionality until and unless hover is visible? As per the icon that looks like to apply the filters, not meant for clearing the already applied filters.

In short, create a separate button that's sole purpose is to clear the applied filter. You can add the button in the header/footer as shown here in Smart GWT Showcase.

To clear the already applied filter simply call ListGrid#fetchData() again without passing any criteria means null on click of the new button.

这篇关于传递一个处理程序来过滤按钮属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆