PDA

View Full Version : Grid column text align issue



abcdef
15 Sep 2011, 12:11 AM
How do I set text-align on a grid column of a grid that is un-selectable, un-focusable, and header-less?

I have the following listeners on the grid:


listeners: {
beforeselect: function() {
return false;
},
beforeitemmouseenter: function() {
return false;
}
},


and my column renderer looks like:



columns: [
{
header: '',
dataIndex: 'key',
flex: 1,
renderer: function(value, metadata) {
metadata.style = 'text-align: right';
return value;
}
},
{
header: '',
dataIndex: 'value',
flex: 4,
renderer: function(value, metadata) {
metadata.style = 'text-align: left';
return value;
}
}
]


On inspecting the dom, I find that the actual div element has:



unselectable="on" class="x-grid-cell-inner x-unselectable" style="text-align: right; text-align: left;"


The text-align: 'right' rule is being overridden. How can I stop this?

tobiu
15 Sep 2011, 12:25 AM
that's easy:



{
align: 'right',
header: '',
dataIndex: 'key',
flex: 1
}

abcdef
15 Sep 2011, 12:51 AM
that's easy:



{
align: 'right',
header: '',
dataIndex: 'key',
flex: 1
}


Tried that already. Doing that forces a blank header to render. Never mind the blacked out part.

See attached screenshot.

28068

tobiu
15 Sep 2011, 2:50 AM
seems like a bug. which version are you using?

abcdef
15 Sep 2011, 9:52 AM
seems like a bug. which version are you using?

4.0.2a.

abcdef
17 Sep 2011, 3:17 PM
Any workarounds?