:: Forum >> Version 2 >>

Capture a grid resize event

Hi all:

I need to capture a grid resize event; my grid is at Width and Height 100%, so I need an event firing when the grid is resized.

I've tried setEvent("onresize", function), but it isn't good for me, because it fires all the onresize events in the grid, even when a column is resized by user.

I've been searching something like obj.onPanelWidthChanged , but it doesn't work, and I can't figure out a way to attach the event directly to the grid.
Jorge A. Pascual
Monday, June 18, 2007
You should use onresize event but you can filter out the events coming from the inner elements by comparing event.srcElement and grid element -

var obj = new AW.UI.Grid;
obj.setId("myGrid");
obj.setCellText("cell");
obj.setColumnCount(10);
obj.setRowCount(10);

obj.setEvent("onresize", function(event){
    if (
event.srcElement == this.element()){
        
window.status this.element().offsetWidth;
    }
});

document.write(obj);
 
unfortunately it only works in IE because Firefox does not support onresize event in div or span elements.
Alex (ActiveWidgets)
Monday, June 25, 2007



This topic is archived.

Back to support forum

Forum search