Hello again,
I've ran into a slight bump in the road while attempting to get the column model for the cell that was clicked in the grid panel. Seems "getColumnModel()" is no longer a method for the grid panel.
In my Ext Js 3 application I was able to use a listener on the grid for the "cellclick" event that allowed me to act upon the cell in the column that was clicked. I have a hidden column which contains the name of the file I want to download and I created an iframe that would be used to download the file asynchronously.
Code snippet below:
Code:
listeners: {
cellclick: function(grid,rowIndex,colIndex,e) {
if (colIndex == 3) {
var rec = grid.getStore().getAt(rowIndex);
var fieldname = grid.getColumnModel().getDataIndex(colIndex + 1);
var filename = rec.get(fieldname);
if (!filename) return;
var download_iframe = Ext.getCmp("report-download");
if (!download_iframe) {
download_iframe = document.createElement('iframe');
download_iframe.id = 'report-download';
download_iframe.style.display = 'none';
download_iframe.height = '100';
download_iframe.width = '600';
document.body.appendChild(download_iframe);
download_iframe.src = SC.addToken(_const.BASE_PATH + '/download_report.php?FileName=' + escape(filename));
} else {
download_iframe.src = SC.addToken(_const.BASE_PATH + '/download_report.php?FileName=' + escape(filename));
}
e.stopEvent();
}
}
}
Is there an equivalent in Ext Js 4? If not, can anyone help me figure out how to go about doing the same thing getColumnModel() use to do in Ext Js 3?
Any help would be much appreciated.
Thank you in advance,
Shawn