Grid: Sort by invisible column

Given a grid backed by an SQLContainer, I’d like to include a column in the sort criteria but not show that column in the grid.


  1. include the column in the sort criteria then remove the column using removeColumn(thatColumn). Result: It functions as expected with no perceived problems but ?debug exposes a client side error. The client side grid doesn’t like being told to sort by a column that doesn’t exist, but it works. Is that OK, or could the error manifest as a problem somehow?

  2. Include the column, sort by it, don’t remove it but set its width to zero. That works, but zero apparently doesn’t mean zero. The column has a narrow default width which can be seen. I want it to look like it has been removed, = gone.

  3. Just include the column. That works and avoids the client side error, but the data is not relevant to the user so impairs the cleanliness of the UI.

Any suggestions?

Hi Steve,

Instead of using removeColumn, have you tried to hide the column instead? You can do that with grid.getColumn(propertyId).setHidden(true). Number 2 is definitely not the way to go and you shouldn’t need to resort to number 3.


Simple, perfect, error free - and embarassing that I didn’t see this previously. Thanks!

Glad I could help!