3.2.0

Column headers not flush when right aligned

Hi,

I've noticed that when I right align columns and headers, althoght the data in the column is flush against the right side of the cell, the text in the header is not. Instead there appears to be a small amount of padding. Does anyone know of a way to remove this??

Thanks, Helen.

PS The example below demonstrates this problem. Look at the alignment of the second column - "Value" is not flush against the right hand side of cell

var data = [ 
    ["aaa", "111", "02/21/2005", "A"], 
    ["bbb", "22", "01/01/2004", "A"], 
    ["bbb", "22", "11/10/2002", "B"] ,
    ["bbb", "22", "01/31/2003", "A"],
    ["bbb", "22", "01/31/2004", "B"]
];

var headers = ["Code used to distinguish data", "Value", "Due By", "Type"];

var string = new AW.Formats.String; 
var number = new AW.Formats.Number; 
var date = new AW.Formats.Date;

var obj = new AW.UI.Grid; 
obj.setCellText(data);

obj.setCellEditable(true);
obj.setHeaderText(headers);
obj.getHeaderTemplate(1).setStyle("text-align", "right");
obj.getCellTemplate(1).setStyle("text-align", "right");

obj.setCellFormat([string, number, date, string]); 

obj.setColumnCount(data[0].length); 
obj.setRowCount(data.length); 
obj.setSize(400,200)
document.write(obj);
Helen Williamson
March 2,
Helen,

Sorry to hijack your thread ( I apologise) but some months ago you posted a solution for selecting mutiple rows in a grid. I've tried to implement you solution, following your instructions, and it dos not seem to work.

Would it be possible to for you to say whether you solution still works in V2.0 standard ?

The actual thread I raised this under is : http://www.activewidgets.com/javascript.forum.12460.2/bug-in-grid-onrowctrlclicked-action.html

Once again - sorry for hijacking this thread - just desparate to find a solution
Yasdnil
March 2,
That's a reserved space ( in the header template) for sort indicator "arrow". ( I think it's done this way to allow compability with wraped text in headers).
If you remove it, then the "arrow" will never been displayed, but
for the case you don't need it , just apply this style to every column .
.aw-grid-headers .aw-column-1 .aw-grid-sort {display: none;}
Carlos
March 2,
Hi Yasdnil,

The solution I described does definately still work in V2.0 standard. Sorry, but I can't quite remember the steps I described to get the ctrl click row selection to work and I can't find the original post. Do you have a link to it?

Thanks, Helen
Helen Williamson
March 2,
I did have - and now I've lost it amongst all the posts
I'll try and dig it out again - and see what I have done wrong.

Thanks Helen.
Yasdnil
March 2,
OK - Helen - found yur orignal post have have replied there (so as to prevent a total hijack of this thread)

http://www.activewidgets.com/javascript.forum.11188.1/will-multi-select-features-return.html
Yasdnil
March 3,
And the original problem (post #1 in this thread :-) is due to a bug in grid CSS. Here is the solution -

.aw-sort-none .aw-grid-sort {
    display: none!important;
}
Alex (ActiveWidgets)
March 3,

This topic is archived.

See also:


Back to support forum