mitchellsimoens/Ext.ux.touch.grid — Issue #2: Missing toggleColumn Function (provided)
Author: flyingmoose
Created: 2012-02-10 16:51:20+00:00
State: open

Noticed toggleColumn from Ext.ux.TouchGridPanel was missing. Here's one I wrote to fit my needs if anyone is looking for one.

I added the following to View.js

```javascript

toggleColumnVisible: function(dataindex, visible) {
var me = this;
var el = me.getEl(),
headerCells = el.query('.x-grid-header .x-grid-cell[dataindex="'+dataindex+'"]'),
dataCells = el.query('.x-dataview-item .x-grid-cell[dataindex="'+dataindex+'"]'),
cell;

if(headerCells.length > 0) {
cell = Ext.get(headerCells[0]);
cell.setVisible(visible);
}
for(var i = 0, j = dataCells.length;i < j; i++) {
cell = Ext.get(dataCells[i]);
cell.setVisible(visible);
}
}

```

Thanks for all your hard work on this extension Mitchell!