9 Feb 2017

Fixing Firefox issues with column headers for dojox.grid.EnhancedGrid

In Firefox, clicking a dojox.grid.EnhancedGrid’s column header to change sorting only works for the first column. Clicking another column’s header only shows a splitter. The same goes for right-clicking a column header to bring up a popup menu: it only works in the first column. In other browsers this works fine.

The cause seems to be a workaround for an issue in older Firefox versions, implemented in EnhancedGrid.js. The issue no longer exists in recent Firefox versions, but the workaround introduces the issues mentioned in the first paragraph. This is detailed in this bug. The bug also has a proposed fix, which never got into the dojo release (support for EnhancedGrid is very limited; dojo urges us to migrate to dgrid and/or gridx instead).

So we need to apply our own workaround to get the grid working properly again in Firefox (or migrate to dgrid/gridx if we have the time and the energy). A workaround to work around the workaround, if you see what I mean. This means neutralizing the function createView in EnhancedGrid.js. I managed to do so by assigning my own createView function to the grid which just calls this function in the base class (DataGrid). I added the following to the grid's data-dojo-props:


createView: function () { return dojox.grid.DataGrid.prototype.createView.apply(this, arguments); }

No comments:

Post a Comment