3.2.0

px versus em

setColumnWidth() like other methods to set dimension properties are implicitely in "px" - is there any reason why it's not "em" ?

How would I set it in "em" ?
Philippe Marzin
December 16,
Use styles
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<link rel="stylesheet" href="../activewidget/runtime/styles/aqua/aw.css" type="text/css" />
<script language="javascript" type="text/javascript" src="../activewidget/runtime/lib/aw.js"></script>
</head>
<body>
<p>
<style>
.aw-column-0 {width:80em}	
.aw-column-1 {width:80px}	
</style>
<script>
    var obj = new AW.UI.Grid;
    obj.setSize(1000, 200)
    obj.setCellText("text");
    obj.setHeaderText("header");
    obj.setColumnCount(10);
    obj.setRowCount(10);
    document.write(obj);
</script>
</body>
</html>
Bryn
December 16,
The question is more general than that - dimensions such as header height, row height, column width should be expressed in "em" unit to allow to zoom easily.

A side effect to the question, is to get all information in the same place to workaround the issue, including "font-size" in %
Philippe Marzin
December 17,
All AW methods expect numeric width or height arguments (pixels). For any other units you should either use CSS rules in the stylesheet or setStyle(name, value) method, for example -

obj.setStyle("width", "10em");
Alex (ActiveWidgets)
December 17,
Yeah, that's what the documentation and the author says but ... To be able to fit in requirements to accomodate impaired people, it's a must to be able to zoom and "em" is the most useful unit.

So your answer looks like that ok, you dismiss, no care. Is that the definitive answer?

By the way, there is no such a place where all "objects" within the grid are named - properties and objects are differents. If I fix the width of a column using STYLE getColumnSize() always return 100. A clear picture is required for that.

Philippe Marzin
December 17,

This topic is archived.

See also:


Back to support forum