views:

463

answers:

2

Hi there,

How can I increase/decrease the default dojo datagrid font size, should I do this in CSS or there's property I can set when extending the DataGrid class. Thanks in advance!

David

+2  A: 

You should set it in CSS... Always set visual sizing in CSS with dojo/dijit/dojox.

Sometimes the documentation of the CSS you should be specifying isn't clear, so I tend to use FireBug on the rendered page to identify the element and the class that has been assigned and set the CSS that way. The grid is particularly difficult because even though they have done a good job with it, it does render slightly differently in different browsers because of the limitations of each browser (IE6 being the biggest pain).

I just looked at an app of mine at it seems the class is rather straightforward, being dojoxGrid

Kitson
+3  A: 

Building off what Kitson said, you can do something like this:

<style type="text/css">
.dojoxGrid table {
   margin: 0;
}
.dojoxGrid th, tr {
   font-size: 8pt;
}
</style>

But as Kitson mentioned, Firebug can be very useful in discovering what class you should use in your style sheet. These are two classes that I happen to pick out using that method.

Lee Fogel