GXT TreeGrid Selection Event/Listener

In the evolution of the Ext GWT (GXT) framework, there seemed to have been some change as to how selection events of trees/tree grids can be intercepted. In release 2.2.1, the following approach works:

treeGrid.getSelectionModel().addSelectionChangedListener(new SelectionChangedListener<ModelData>() {

            @Override

            public void selectionChanged(SelectionChangedEvent<ModelData> se) {

                GWT.log(“selection changed from getSelectionModel”);

            }

        });

The following approaches do not work:

store.addListener(Events.SelectionChange, new SelectionChangedListener<TreeModel>() {

            @Override

            public void selectionChanged(SelectionChangedEvent<TreeModel> se) {

                GWT.log(“selection changed”);    

            }

        });

        

        treeGrid.addListener(Events.SelectionChange, new SelectionChangedListener<TreeModel>() {

            @Override

            public void selectionChanged(SelectionChangedEvent<TreeModel> se) {

                GWT.log(“selection changed”);    

            }    

        });

Resources:

TreeBinder JavaDoc – TreeBinder seems to be deprecated, use selection model instead.

One thought on “GXT TreeGrid Selection Event/Listener

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s