Closed Thread Icon

Topic awaiting preservation: Preloading tables controlled by the TDC (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8411" title="Pages that link to Topic awaiting preservation: Preloading tables controlled by the TDC (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Preloading tables controlled by the TDC <span class="small">(Page 1 of 1)</span>\

 
Sam
Bipolar (III) Inmate

From: Belgium
Insane since: Oct 2002

posted posted 11-26-2002 08:45

Suppose you have a text file which contains 100 names of people together with their email addresses and a number (1..4) indicating some kind of property. This text file is extracted out of an access database, managed by someone else then me.

With the TDC I can bind this text file to my website but all the data is represented as 'text'. Of course I want the email addresses to be displayed as link to the email. Depending on the number in the file I want to display a different icon. I know you can embed html code in the text file and display it as html with the property dataFormatAs="HTML", but this way, with all the html code, my text file gets to big (and slow).

So I'm looking for a way to preload this table (provided with data from a text file). I think it should be possible to load this table in an invissible layer/frame and then dynamically generate a visible page with the table containing the formatted data referencing the table in the invisible frame/layer.

Before I start programming with this it would be nice if someone could tell me if this is a good way to start or in case there is another easyer way, please tell me.

thanx

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 11-26-2002 15:18

I think you're going to want to do this on the server side.

DmS
Paranoid (IV) Inmate

From: Sthlm, Sweden
Insane since: Oct 2000

posted posted 11-26-2002 15:51

I know that using "Data binding" in Internet Exploder you can let a webpage read info from a textfile, bind it to the page and create tables from it, then you can sort it on the fly and so on. But I don't think you can control what kind of HTML it should put out to the extent that your description says (links and icons). Plus if I remember correctly the file has to be formatted "properly" (I think it is comma separated) to work.

I agree with Slime, grab the file on the server, process it using PHP/PERL, ASP, whatever you have access to and spit out pure HTML to the browser.

That way you won't be tied to a specific browser technique either.
/Dan



{cell 260}
-{ a vibration is a movement that doesn't know which way to go }-

Sam
Bipolar (III) Inmate

From: Belgium
Insane since: Oct 2002

posted posted 11-27-2002 09:47

I've found a way to get what I want. Here it is in case someone is interested in it. Comments are always welcome.
(PS: I haven't tested this version, but if there are some mistakes in it I'm sure you know how to fix it.)

<html>
<head>
<object id="obj1" classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<param name="FieldDelim" value=";">
<param name="Useheader" value="TRUE">
<param name="DataURL" value="yourFile.txt">
</object>
<script language="javaScript">
function drawTable()
{
rs = document.getElementById('obj1').recordset;
retval = "<table id='tab1'>";
retval += "<thead>";
retval += "<tr>";
retval += "<th>Name</th>";
retval += "<th>Email</th>";
retval += "<th>Function</th>";
retval += "</tr>";
retval += "</thead>";
retval += "<tbody>";
rs.MoveFirst();
while (!rs.EOF)
{
retval += "<tr>";
retval += "<td>"+rs("Name").value+"</td>";
// This cell contains an email address
retval += "<td><a href='mailto:"+rs("Email").value+"'>"+rs("Email").value+"</a></td>";
// This cell displays different icons depending on the value of some properties.
if (rs("property1").value=='1') retval += "<img src='pic1.gif'>";
if (rs("property2").value=='1') retval += "<img src='pic2.gif'>";
retval += "</td>";
retval += "</tr>";
rs.MoveNext();
}
retval += "</tbody>";
retval += "</table>";
div_table.innerHTML = retval;
</script>
</head>
<body onLoad="drawTable();">
<DIV id="div_table"></DIV>
</body>
</html>

« BackwardsOnwards »

Show Forum Drop Down Menu