:: Forum >>

Disabling column resizing in 2.0

Does anybody have any ideas how I could selectively (for some columns and not others..) do this? Or, how I could, at least, turn all resizing off? Thanks very much.

Joe
Joe Hudson
Saturday, November 5, 2005
To disable all resizing, just hide all separators with:
.aw-grid-separator {display: none;}
I could'nt find a way yet to do it selective. Should be a function-header-template, but no luck.
HTH
Carlos
Saturday, November 5, 2005
Ok, thanks Carlos.

Joe
Joe Hudson
Saturday, November 5, 2005
Joe,
I just find a tricky way by css style definition:
document.styleSheets[document.styleSheets.length-1].addRule("#myGrid-separator-1-0" , "display: none;");
combine it with:
#myGrid .aw-column-1 {width: 150px; border-right: 1px dotted #ccc;}
and you get a column header (plus col-data) separator not-resizable.
HTH
Carlos
Sunday, November 6, 2005
Sorry replace "dotted" with "solid"
Sunday, November 6, 2005
Sorry, the first one only works in IE, for IE + Mozilla browsers you can define css inside style tags by:
#myGrid-separator-3-0 {display: none}
Or do it by scripting (single or loop after document.write(obj) )
document.getElementById('myGrid-separator-3-0').style.display = "none";
for( cs=0;cs<obj.getColumnCount();cs++) {
document.getElementById('myGrid-separator-' + cs + '-0').style.display = "none";
}
Carlos
Monday, November 7, 2005
You could override the aw implementation of "onmousedown" event to disable column resizing. Also change the cursor css attribute for the .aw-grid-separator selector.

<style>
.aw-grid-separator {
cursor: default;
}
</style>

var obj = myGrid.getSeparatorTemplate();
obj.setEvent("onmousedown", function(event) { event = null; });

This will turn off resizing for all columns. If you want to do it selectively you'll have to determine the column in the mouse down event code above and only set the event to null where appropriate.
Take a look at the source file "separator.js"
BT
Monday, November 7, 2005
Thanks a lot .. BT
Carlos
Monday, November 7, 2005

This topic is archived.


Back to support forum

Forum search