:: Forum >>

Minimum width for Column Headers

I have been reading all of the posts and don't see what I am looking for addressed. I am planning on using the grids dynamically, creating and destroying then on the fly. So far they are working great! I am a very happy camper. I had created a grid component of my own, which I am currently using (I hope to replace it with yours), and in my component I am able to check to see if the Column Header is too big to fit in the given width for the column and if it is I increase the column width to make it fit. Thus giving me a minimum width of the header text. Is there a CSS style or another way that I can set the width to be no smaller then the text?

This is an awesome grid! Keep up the good work. Once I can demonstrate that it is a better grid then mine we will be getting one of the developer licenses.

Thanks,
Jim
Jim Hunter
Saturday, August 14, 2004
Maybe this could help:

obj.timeout(function(){
var i, j, count = this.getColumnProperty("count");

    var ss = document.styleSheets[document.styleSheets.length-1];

for (i=0; i<count;i++){

var width = this.getTemplate("top/item", i).element().firstChild.scrollWidth;

        var selector = "#" + this.getId() + " .active-column-" + i;

        var rule = null;
        for(j=0; j<ss.rules.length;j++){
            if(ss.rules[j].selectorText == selector){
                rule = ss.rules[j];
                break;
            }
        }
        if (rule) {
            rule.style.width = width;
        }
        else {
            ss.addRule(selector, "width:" + width + "px");
        }
        this.getTemplate("layout").action("adjustSize");
}

});




Put the script after document.write(obj)
Alex (ActiveWidgets)
Monday, August 16, 2004
Very nice! The funtion works perfect, but is there an event that we can attach it to that fires right after the grid is rendered instead of 3 seconds after the grid is rendered? Or, what is the timeout event? can I change it's wait time to be a few milliseconds instead of a few seconds? This would get rid of the noticeable delay before the columns are resized.

Thanks for the quick response!
Jim Hunter
Monday, August 16, 2004
Turns out the delay that I am seeing is caused by the function. it fires instantly but takes about 3 seconds to adjust the column sizes. I am working on something that I hope will be faster, will post it if I am successfull.
Jim Hunter
Tuesday, August 17, 2004

This topic is archived.


Back to support forum

Forum search