PDA

View Full Version : ColumnModel rendering of hidden cols



tryanDLS
22 Nov 2006, 10:52 AM
Jack,

I was looking at the HTML output for a grid and I see that spans are built for cols that are tagged as hidden in the CM. I can see the need for this in order to provide something like a rowId for client manipulation, but I'm thinking maybe there should be another option here - maybe 'Ignore'. This would completely skip rendering the column. From a security perspective there could be data that's in a dataset that shouldn't be output to the client at all. The ideal situation would be yo not send those columns, but if you're working with a dataset that you don't control, that's not always the case. It still wouldn't be ideal b/c you could still see the actual data via the debugger, but at least you would not add nodes to the DOM that aren't going to be seen. I could see this being a big deal in cases where a big dataset (# of columns) is retrieved, but it's displayed in multiple gridViews that only show a subset of the columns.

jack.slocum
22 Nov 2006, 1:00 PM
What you are looking for are not hidden columns, but the "dataIndex" property on a column. You can render any column you want and map them to any data field. You don't have to add hidden columns. This was added in beta3 I think.

tryanDLS
22 Nov 2006, 1:12 PM
Oh, I thought that the schema fields collection had to match the data and that's why a column had to be flagged hidden. Instead, omit it from the schema and the CM and it doesn't render :)

jack.slocum
22 Nov 2006, 1:33 PM
Right. Also, your column model doesn't have to match your data model. You can use the dataIndex config on the column model to map columns to whatever index in the data you want.