pkt1583 / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

TreeNode.setIconCls(String) cannot change icon under Firefox after the node has been rendered #449

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
  After rendering a node in a tree, it is not possible to change its icon 
under Firefox using setIconCls(String) method. The same code works fine 
under IE. The method changes the value of 'classname' attribute, but 
Firefox likes more 'class' attribute instead :) Thus, a simple patch is 
necessary:

Index: 
C:/workspace/GWTExt/main/src/com/gwtext/client/widgets/tree/TreeNode.java
===================================================================
--- 
C:/workspace/GWTExt/main/src/com/gwtext/client/widgets/tree/TreeNode.java   
(revision 1850)
+++ 
C:/workspace/GWTExt/main/src/com/gwtext/client/widgets/tree/TreeNode.java   
(working copy)
@@ -559,6 +559,7 @@
             Element el = getUI().getIconEl();
             if (el != null) {
                 DOM.setElementAttribute(el, "className", "x-tree-node-icon 
" + iconCls);
+                DOM.setElementAttribute(el, "class", "x-tree-node-icon " + 
iconCls);
             }
         }
     }

The patch has been tested with GWTExt 2.0.5 and Firefox 3.x

Original issue reported on code.google.com by pedjak@gmail.com on 4 Nov 2008 at 10:38

GoogleCodeExporter commented 8 years ago
Fixed as described above

Original comment by mlim1...@gmail.com on 9 Nov 2008 at 8:37