3.2.0

How to reverse the initial sort order

Hi,

I have only just found ActiveWidgets and they might be about to change my life!!!

However, I AM NOT A PROGRAMMER and although I can make the small changes needed to customize AW for my uses, I am struggling to change the sort order.

I have based my source code on the examples you get when downloading the source and kept them (at this stage) in /examples/grid directory.

All my files come in reverse date order...

=======Source Data begins
"09/22/05 12:49:22","SPF","xxxx@xxxx.edu","xxxx@xxxx.co.uk","Re: Phharmaceutical Check thi s Offr","Deleted","Sender is forged (SPF Fail)"
"09/22/05 15:15:36","SPF","xxxx@xxxx.com","xxxx@xxxx.co.uk","Does 8incches Enough 4 U? H6ZE5","Deleted","Sender is probably forged (SPF Softfail)"
======Source Data ends

And the sort works perfectly when I click twice on the heading, except I would like it to so automatically on loading.

Source code below...

Any advice would be greatly appreciated.

Andy

=======Source Code begins

<html>
<head>
<title>email security - FORGED SENDERS LIST</title>
<style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>

<!-- ActiveWidgets stylesheet and scripts -->
<link href="../../runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="../../runtime/lib/grid.js"></script>

<!-- grid format -->
<style>
.active-controls-grid {height: 100%; font: menu;}

.active-column-0 {width: 100px;}
.active-column-1 {width: 31px;}
.active-column-2 {width: 200px; text-align: right;}
.active-column-3 {width: 200px; text-align: right;}
.active-column-4 {width: 200px; text-align: right;}
.active-column-5 {width: 45px; text-align: right;}
.active-column-6 {width: 200px; text-align: right;}

.active-grid-column {border-right: 1px solid threedshadow;}
.active-grid-row {border-bottom: 1px solid threedlightshadow;}
</style>
</head>
<body>

<script>

// create ActiveWidgets data model - text-based table
var table = new Active.Text.Table;

// provide data URL - plain text comma-separated file
table.setURL("L:/spf.log");

// start asyncronous data retrieval
table.request();

// define column labels
var columns = ["Date/Time", "SPF", "Sender", "Recipient", "Message", "Action", "Reason"];

// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;


// provide column labels
obj.setColumnProperty("texts", columns);


// provide external model as a grid data source
obj.setDataModel(table);

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

</script>
</body>
</html>

=======Source Code ends
Andy Labrow
October 25,

This topic is archived.

See also:


Back to support forum