I think I will figure out the column width in php and saved as array when I do the
$SavedStrLen = array();
function aw_cells($dataset,$dataset1)
{
$rows = array();
while ($fields = @mysql_fetch_field($dataset1))
{
$fieldsarray[] = $fields->name;
}
while ($record = @mysql_fetch_row($dataset))
{
$rowCount = count($record);
$cols = array();
for($i = 0; $i < $rowCount; $i++)
{
$cols[] = '"'.addslashes($record[$i].'"';
GetMaxStrLength( $fieldsarray[$i] , $record[$i] );
}
$rows[] = "\t[".implode(",", $cols)."]";
$rows1[] = implode(';',$cols);
}
echo "[\n".implode(",\n",$rows)."\n];\n";
}
function GetMaxStrLength( $WhoseString, $newString )
{
global $SavedStrLen;
$StrLen = strlen($newString);
if ( $StrLen > $SavedStrLen[$WhoseString] )
$SavedStrLen[$WhoseString] = $StrLen;
}
I will save the key names and the max charatcers
Does this sound like the right way of doing this or am I totally missing something.
thanks
Steven
Yes but I want all the columns to be drawn correct on page load and to have to do that all the time doesn't sound right.
I think my way is going to be faster and clean for the user.
As this doesn't resize the grid to handle this resize and it there is just 1 column you can double the separator as there is no separator.
Thanks anyway but I have my almost done.
I will post my answer when all done here.
Steven
<html>
<head>
<script src="runtime/lib/aw.js"></script>
<link href="runtime/styles/runtime/styles/aqua/aw.css" rel="stylesheet" >
</head>
<body>
<script>
try
{
var adjustment = 15; // Ajustment for cells widths
var myColumns = [
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:00:09:38>00:17:f2:00:09:38</A>","2009-04-02 19:24:54","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7548908>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f8>1.7f8</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B04>MP11.005C.B04</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7548908"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:00:09:38>00:17:f2:00:09:38</A>","2009-04-03 10:55:05","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549697>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f8>1.7f8</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B04>MP11.005C.B04</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549697"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:00:09:38>00:17:f2:00:09:38</A>","2009-04-02 19:24:54","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7548908>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f8>1.7f8</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B04>MP11.005C.B04</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7548908"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:00:09:38>00:17:f2:00:09:38</A>","2009-04-03 10:55:05","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549697>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f8>1.7f8</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B04>MP11.005C.B04</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549697"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:00:09:38>00:17:f2:00:09:38</A>","2009-04-02 19:24:54","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7548908>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f8>1.7f8</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B04>MP11.005C.B04</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7548908"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:00:09:38>00:17:f2:00:09:38</A>","2009-04-03 10:55:05","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549697>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f8>1.7f8</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B04>MP11.005C.B04</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549697"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"],
["<A href=
http://www.yoursite.com/docs/foo/web2.php?machineID=00:17:f2:02:46:96>00:17:f2:02:46:96</A>","2009-04-03 10:52:23","<A href=
http://www.yoursite.com/docs/foo/testCaseReport.php?testCase=3>fstestAutomation.sh testCase 1</A> (<A href=
http://www.yoursite.com/docs/foo/testSummary.php?trID=7549694>Config</A>)","Pass","0","<A href=
http://www.yoursite.com/docs/foo/osSummary.php?osRelease=9G3543>Mac OS X 10.5.6 9G3543</A>","<A href=
http://www.yoursite.com/docs/foo/smcSummary.php?smcVersion=1.7f10>1.7f10</A>","<A href=
http://www.yoursite.com/docs/foo/efiSummary.php?efiVersion=MP11.005C.B07>MP11.005C.B07</A>","<A href=
http://www.yoursite.com/docs/foo/platformSummary.php?modelMajor=foo>foo</A>","7549694"]
];
var obj = new AW.UI.Grid;
obj.setCellText(myColumns);
var Theheader = ["machineID", "Start_Time", "Description", "Results", "Pass_Count", "OS", "SMC", "EFI", "Model", "Test_results_ID"];
obj.setHeaderText(Theheader);
var TotalColumnsNumbers = Theheader.length;
var rowcount = myColumns.length;
// enable virtual mode
obj.setVirtualMode(true);
obj.setColumnCount(TotalColumnsNumbers);
obj.setRowCount(rowcount);
obj.setRowHeight(20);
obj.setCellEditable(false);
function AutoResize(TotalColumnsNumbers)
{
var TotalTableWidth = 19;
var SetSize = 0;
// I had to write the hidden field here to make it work
document.write('<span id="mine" style="font-size:11px;font-family:Tahoma;width:auto;visibility:hidden;white-space:nowrap;"></span><br>');
var hiddenSpan = document.getElementById("mine");
for ( var hh = 0; hh < TotalColumnsNumbers; hh++)
{
var MaxLength = 0;
for (var i = 0; i < obj.getRowCount(); i++)
{
var text1 = obj.getCellText(hh, i);
hiddenSpan.innerHTML = text1;
if (hiddenSpan.offsetWidth > MaxLength)
MaxLength = hiddenSpan.offsetWidth;
}
var Currentsize = obj.getColumnWidth(hh);
var text = obj.getHeaderText(hh, 0);
hiddenSpan.innerHTML = text;
if (hiddenSpan.offsetWidth > MaxLength)
{
MaxLength = hiddenSpan.offsetWidth;
}
SetSize = (MaxLength + adjustment);
obj.setColumnWidth(SetSize , hh);
//document.write("col # " + hh + " CurrentSize = " + Currentsize + " NewSize = " + SetSize + " Max Text length = " + MaxLength + "<br>");
}
// Resize the table to fit the new column widths
for ( var hh = 0; hh < TotalColumnsNumbers; hh++)
{
var tempcolum = obj.getColumnWidth(hh);
TotalTableWidth = TotalTableWidth + tempcolum;
}
obj.setStyle("width", TotalTableWidth + "px");
// Don't show all of the table is really large
if(myColumns.length >= 100)
obj.setStyle("height", "600px");
else
{
size = 96 + (myColumns.length * 18 - 16);
obj.setStyle("height", size);
}
}
AutoResize(TotalColumnsNumbers); // Just Pass in the number of Columns you have
document.write(obj);
}
catch(ex)
{
alert ("error " + ex);
}
</script>
</body>
</html>
This topic is archived.