博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
How to cancel selection for TreePanel(GXT)
阅读量:7072 次
发布时间:2019-06-28

本文共 677 字,大约阅读时间需要 2 分钟。

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

转载于:https://www.cnblogs.com/liwp_Stephen/p/3575260.html

你可能感兴趣的文章
实例:接口并发限流RateLimiter
查看>>
vba 排序和复制指定区域到新的xls文件中
查看>>
std::strncpy 简介
查看>>
小学生四则运算算术题
查看>>
python并发编程之多进程
查看>>
2019.4.17 区块链论文翻译
查看>>
Loj #2494. 「AHOI / HNOI2018」寻宝游戏
查看>>
浅谈卷积和C++实现
查看>>
RabbitMQ队列/Redis缓存
查看>>
进阶第八课 Python模块之textwrap
查看>>
spring boot 配置mybatis plus 控制台打印sql
查看>>
<video/><img/>路径带中文,显示乱码(URIEncoding)
查看>>
用Java制作一个简单的图片验证码
查看>>
iOS开发中如何给UITableViewCell添加动画
查看>>
测试开发面试准备之HTTP协议-三次握手
查看>>
angularjs modal模态框----创建可拖动的指令
查看>>
Sterling学习
查看>>
SQL Server进制
查看>>
Entity Framework 批量插入很慢
查看>>
再次写给我们这些浮躁的程序员
查看>>