I've got a the below javascript function that's called from OnGridCreated event handler. Everything works fine in Chrome, IE8 and IE9 browsers but I'm getting a javascript error in IE7 on the masterTableView.showColumn(columnIndex) or on masterTableView.hideColumn(columnIndex).
It seems the IE7 error occures when a column is already hidden, and you're trying to use hideColumn on it. Also, if a column is visible showColumn will produce an error. As a work around, I tried to check the column visibility before trying to change visibility.
if (isDisplayed == column.get_visible()) {
return;
}
However, even though column's get_visible() method returns an appropriate value after showColumn or hideColumn methods, the actual visibility of columns on the screen is not changed. It seems like the columns are not added to this._hiddenCols collection.
Thanks,
Alex
function toogleColumnDisplay(masterTableView, columnUniqueName, isDisplayed) {
var column = masterTableView.getColumnByUniqueName(columnUniqueName);
var columnIndex = column.get_element().cellIndex;
if (isDisplayed) {
masterTableView.showColumn(columnIndex);
}
else {
masterTableView.hideColumn(columnIndex);
}
}
It seems the IE7 error occures when a column is already hidden, and you're trying to use hideColumn on it. Also, if a column is visible showColumn will produce an error. As a work around, I tried to check the column visibility before trying to change visibility.
if (isDisplayed == column.get_visible()) {
return;
}
However, even though column's get_visible() method returns an appropriate value after showColumn or hideColumn methods, the actual visibility of columns on the screen is not changed. It seems like the columns are not added to this._hiddenCols collection.
Thanks,
Alex