简体   繁体   English

如何将SelectHandler添加到TabitemConfig Gxt3?

[英]How to addSelectHandler to TabitemConfig Gxt3?

I'am working in GXT3 project and i need to add a SelectEvent to TabItemConfig in TabPanel. 我正在GXT3项目中工作,我需要在TabPanel中的TabItemConfig中添加一个SelectEvent。 For example, we can't go to another tabItem if the form in current tabItem doesnt't validate. 例如,如果当前tabItem中的表单未通过验证,则无法转到另一个tabItem。

Why can't you use 你为什么不能使用

        TabPanel panel;
        panel.addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() {

            @Override
            public void onBeforeSelection(BeforeSelectionEvent<Widget> event) {
                //some condition
                event.cancel();
            }
        });

you can get event.getItem() and do validation of current tabItem 您可以获取event.getItem()并验证当前的tabItem

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM