PDA

View Full Version : Is there an option to disable "Expand" icons in TreeGrid w/o using a TemplateColumn?



MonkeeOfEvil
4 Jun 2012, 7:04 AM
Is there an option that would allow me to disable the "expand" icons from rendering on a specific column in a tree grid?

Right now I have a TreeGrid with 8 columns. The first column is the only one which I would like to have an Expand button on. I was able to get rid of the Expand button on one of the columns by using a TemplateColumn xtype. Is this the only way to do this, or is there an option or something missing in the documentation that allows me to just configure the column to have no "expanders"?

I hope I was being clear on this.

mitchellsimoens
7 Jun 2012, 1:22 PM
You may just have to use CSS to hide it.

MonkeeOfEvil
7 Jun 2012, 2:55 PM
Yeah. You either have to use a TemplateColumn or you have to apply a CSS class to the columns which you do not want the elbow / expand icons included on and set the display to none. I just opted to use TemplateColumn's since I had some other data transformation I wanted done to most of the columns....and I don't like the dom clutter of unused images and what-not.

Anyway, the CSS approach is that you apply a 'hideTriggers' class using the 'tdCls' config of the treecolumn.

Sample below:



.hideTriggers .x-grid-cell-inner img.x-tree-icon,
.hideTriggers .x-grid-cell-inner img.x-tree-expander,
.hideTriggers .x-grid-cell-inner img.x-tree-elbow,
.hideTriggers .x-grid-cell-inner img.x-tree-elbow-end,
.hideTriggers .x-grid-cell-inner img.x-tree-elbow-empty,
.hideTriggers .x-grid-cell-inner img.x-tree-elbow-line { display:none; }