RSS Anobium Business services Ltd MVP 2008
The Groove tumblelog

From concept, prototyping, implementation and support - we are a global leader - creating innovative and high value Microsoft Groove solutions using a wide range of Microsoft (and other) technologies.



Contact me here or at www.Activity4.com

Jan 03
Permalink

Replacement Functions

/*

Function: SetColumnWidths

Force widths of columns in layout.

Remarks: Groove builds your form in a HTML table with

additional columns for field labels. Often these field labels take up more

space than is required, so it very often makes sense to call SetColumnWidths(“20%”);

in your OnAfterInitialize code even when your form layout is only a single column

of fields.

In multi-column layouts (as specified in the Groove Forms designer) you may

want to specify the 1st, 3rd, 5th etc column width to manually set the widths

of the label columns.

Parameters:

arguments - the widths you want the columns to take.

Examples:

(code)

SetColumnWidths( “20%” ); // force first column to 20%

SetColumnWidths( “100px”, undefined, “20%” ); // force first column to 100px and third to 20%

(end)

Returns:

*false* if there was a problem.

*/

function SetColumnWidths() {

try {

var aWidths = arguments;

// Find the first row of the fields table which doesn’t have a “colspan” override

var tr = document.all.FieldsTable.firstChild.firstChild;

while( tr ) {

if( tr.nodeName.toUpperCase() == “TR” ) {

if( tr.innerHTML.toUpperCase().indexOf(“COLSPAN”) == -1 ) {

break;

}

}

tr = tr.nextSibling;

}

if( !tr ) {

return false;

}

SetTRWidths( tr, aWidths );

}

catch(err) {

ShowError(err);

return false;

}

return true;

}

/*

Function: SetTRWidths

Set the individual cells of a table row to the specified widths.

Parameters:

tr - (Table.Row) the row of the table you want to set the widths of.

aWidths - (Array) string description of the width for each column you want to set

See Also:

for examples of width parameters.

*/

function SetTRWidths(tr, aWidths) {

for( var j=0; j

var td = tr.childNodes[j];

if ( td.nodeName.toUpperCase()==”TD” ) {

if ( aWidths[j] ) {

td.style.width = aWidths[j];

td.style.border = “1px solid red”;

}

}

}

}

/*

Function: SetTabGroupColumnWidths

Set the tab width of the fields.

See Also:

for examples of width parameters.

*/

function SetTabGroupColumnWidths()

{

try

{

var aWidths = arguments;

// For every tabgroup (…yes, assume they’re all the same number of columns…),

// Find the first row of the fields table which doesn’t have a “colspan” override

var cT = document.getElementsByTagName( “DIV” );

for( var j=0; j

{

if( cT.item(j).getAttribute( “OBJECTTYPE” )==”TabContents” )

{

var cTR = cT.item(j).getElementsByTagName( “TR” );

for( var k=0; k

{

var tr = cTR.item(k);

if( tr.innerHTML.toUpperCase().indexOf(“COLSPAN”) == -1 )

{

break;

}

}

SetTRWidths( tr, aWidths );

}

}

}

catch( e )

{

return false;

}

return true;

}