zoukankan      html  css  js  c++  java
  • How to cancel selection for TreePanel(GXT)

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

  • 相关阅读:
    Coursera 算法二 week 5 BurrowsWheeler
    pta 编程题7 List Leaves
    pta 编程题6 树的同构
    pta编程题5 Pop Sequence
    pat乙级1067
    pat乙级1060
    pat乙级1059
    1.ActionBar
    安卓开发必须收藏的网站
    genymotion常见问题解答
  • 原文地址:https://www.cnblogs.com/liwp_Stephen/p/3575260.html
Copyright © 2011-2022 走看看