View Full Version : text-selection in TreePanel not working

19 Jun 2012, 12:50 AM

we are using gxt 2.2.4 and try to enable text selection in TreePanels.


..but disableTextSelection(false) does nothing, TreePanel ignores the disableTextSelection-Flag.

Our next try was to change the rendering template of the TreeView and
a. replace unselectable=on with unselectable=off
b. remove the x-unselectable class
c. add the x-selectable class

treePanel.setView(new TreePanelView(){
public String getTemplate(ModelData m, String id, String text, AbstractImagePrototype icon,
boolean checkable, boolean checked, Joint joint, int level,
com.extjs.gxt.ui.client.widget.treepanel.TreePanelView.TreeViewRenderMode renderMode) {
String tpl = super.getTemplate(m, id, text, icon, checkable, checked, joint, level, renderMode);
if (tpl != null) {
tpl = tpl.replace("unselectable=on", "unselectable=off");
tpl = tpl.replace("class=\"", "class=\"x-selectable ");
return tpl;


We defined x-selectable and x-selectable * as follows

.x-selectable, .x-selectable * {
-moz-user-select: text !important;
-khtml-user-select: text !important;
-webkit-user-select: text !important;

...but text selection isn't working...

Is there another working approach to enable text selection?
This is a mandatroy request for our application and I think text selection should be kind of standard, not?

Thanks in advance,