PDA

View Full Version : Non-hideable columns appearing in show/hide columns menu (header row menu)



shiv
22 Jul 2010, 12:59 PM
I've been having this odd problem since I upgraded to 3.0.

I have some grids that include non-hideable columns, using hideable: false in the column config. Previoulsly, these columns wouldn't appear in the "show/hide columns" menu, which makes sense -- if the column isn't allowed to be hidden, why show it as an option on the menu?

However, since I upgraded to 3.0, the non-hideable columns are showing up on the menus -- sort of. The menu now includes a checked box and a "blank" menu item in the order where that column falls in the columnModel. For example:


gridColumnModel = new Ext.grid.ColumnModel({
columns: [
{header: 'Title', dataIndex: 'filmTitle', groupable: false, sortable: true, width: 150, hideable: false, editor: {xtype: 'textfield', allowBlank: false, blankText: 'Film title is required'}},
{header: 'WAB#', dataIndex: 'trackNum', id: 'trackNum', width: 60, groupable: false, editor: {xtype: 'textfield', maxLength: 20, maskRe: /([0-9\s\-]+)$/}},
{header: 'Director', dataIndex: 'filmDirector', groupable: false, editor: {xtype: 'textfield', maxLength: 60}},
{header: 'Email', dataIndex: 'emailAddress', hidden: true, groupable: false, editor: {xtype: 'textfield', maxLength: 60}},
...And the result:

21596

Looking at the HTML output shows that the column is being added as a menu item with a space character.


<li id="x-menu-el-ext-comp-1086" class="x-menu-list-item x-menu-item-checked">
<a id="ext-comp-1086" class="x-menu-item x-menu-check-item" href="#" unselectable="on" hidefocus="true">
<img id="ext-gen117" class="x-menu-item-icon " src="/images/s.gif"/>
<span id="ext-gen118" class="x-menu-item-text"> </span> <!-- NOTE space in this span -->
</a>
</li>
In the old version of ExtJS, hideable: false columns were not added to the menu at all.

Any idea what might be going on here? Thanks

darthwes
22 Jul 2010, 4:25 PM
Whoa. Hide-able, able to be hidden. _NOT HIDDEN_ It means you can use the menu to hide it. hideable: true should mean that you can see them in the menu. Posted code works for me. I don't have grouping on so I don't see a grouping menu, but I have a good column menu, I can toggle selections with hideable and it works in chrome and ff.

I would mention that sometimes I get these errors when I don't have the right version of the .css or if I try to wrap my includes of css files into a minifier, i sometimes get this wierdness. Just thoughts.

shiv
22 Jul 2010, 5:33 PM
Thanks for the response. Unfortunately I made a mistake at the bottom of my first post (corrected now). The column is set to hideable: false (as my code sample correctly showed), but is still showing up in the column menu.

shiv
22 Jul 2010, 5:43 PM
Oh, and I did look at the CSS. The classes within the <li> for the column that's not supposed to be available on the show/hide menu looks the same as all the other <li>s on that menu, so I couldn't see any obvious way to remove that one menu item via CSS. There's no unique identifier or class for a non-hideable column's menu item. Under ExtJS 2, the menu item simply wasn't output.

shiv
23 Jul 2010, 8:50 AM
nothing...?

shiv
24 Jul 2010, 10:06 AM
OK it seems like this is a bug that's been fixed -- mentioned in this thread: http://www.sencha.com/forum/showthread.php?96021

I'll try that.