首页 > 其他 > 详细

How to cancel selection for TreePanel(GXT)

时间:2014-03-02 13:58:47      阅读:527      评论:0      收藏:0      [点我收藏+]

Today, I want to add a function to cancel selection of a tree item in tree panel.

I already implementated this before, but I can’t remember how to do this.

So I search the original code and save here, so next time, I can find it from here.

 

treePanel.getSelectionModel().addListener(Events.BeforeSelect, new Listener<SelectionEvent<ModelData>>() {

            @Override
            public void handleEvent(SelectionEvent<ModelData> be) {
                // Get the model data
                ModelData model = be.getModel();

               // Check the model data and if want to cancel selection, then set canceled value
                if (model.get("disableSelect") != null) {
                    be.setCancelled(true);
                }
            }
        });

How to cancel selection for TreePanel(GXT),布布扣,bubuko.com

How to cancel selection for TreePanel(GXT)

原文:http://www.cnblogs.com/liwp_Stephen/p/3575260.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!