3.0 beta 2

DIVs must still be a major problem! Even simple is hard

This can't possibly be this hard can it??

I am just trying to put up a simple test for a page before I pay $400 for this control.

There are two issues at this point and I can't get any answer let alone a straight one :(

1) simply trying to have a "fixed header" row, meaning not scrolled
2) my dates in the 4th column come from php time() which is in seconds not miliseconds.

Here is my entire code:

<tr><td colspan="2"><b>Paid Viewings:</b> (Scrollable Detail Follows):</td><td>
<tr>
<td width="50%" valign="top" colspan="2">
<div id="PaidDiv" style="position: relative; overflow: scroll; height: 150px;width: 360px">

<script>
// insert javascript arrays produced by PHP functions
var myHeaders = <?= aw_headers($dataset) ?>
var myCells = <?= aw_cells($dataset) ?>

// create grid control
var obj = new AW.Grid.Extended;
obj.setId("obj");

// set number of columns/rows
obj.setColumnCount(myHeaders.length);
obj.setRowCount(myCells.length);
obj.setHeaderHeight(30, 0); // first header row height - 30px
obj.setHeaderCount(1);

// Unix date conversion
var uxdate = new AW.Formats.Date;
uxdate.dataToValue = function(d){return number(d)*1000};
uxdate.setTextFormat("dd/mmm/yy hh:mm:ss");

var str = new AW.Formats.String;
var num = new AW.Formats.Number;

obj.setCellFormat(str,str,num,uxdate);

// set grid text
obj.setHeaderText(myHeaders,0);
obj.setCellData(myCells);

// write grid to the page
document.write(obj);

</script>

</div></td></tr>

Can someone please help me with these two things?

Thank you!
SunBum
September 17,
The argument here should be an array -

obj.setCellFormat([str,str,num,uxdate]);

Also you are forcing scrollbars on the div element, which will move the grid up/down.
Alex (ActiveWidgets)
September 18,
I am getting an error on this line:

uxdate.dataToValue = function(d){return number(d)*1000};

"Object expected"

Here is the full section:

// Unix date conversion
var uxdate = new AW.Formats.Date;
uxdate.dataToValue = function(d){return number(d)*1000};
uxdate.setTextFormat("dd/mmm/yy hh:mm:ss");
obj.setCellFormat(uxdate,3);

When I did the "obj.setCellFormat([str,str,num,uxdate]);"

Only "undefined" is shown in grid area
SunBum
September 18,
should be Number(d), not number(d).
Alex (ActiveWidgets)
September 18,
Alex,

Thank you on BOTH counts!!!

I see what you meant about forcing scroll bars and fixed it, date is just great!

Look forward to a new customer SOON!

Mike
SunBum
September 18,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.