B
bobdedogh
can anyone add live hyperlinks to the sortable table made by the code
supplied by Machi, or know of a simple alternative
bob
Machi wrote Mar 10 1999, 8:00 am
....
Hello Harjinder!
Not sure if you had this in mind or not. This is an example of
data binding and sorting using the Tabular Data Control (tdc)
that ships with IE. Please note that this will only work with IE.
Copy each section. Save the first with any name you like, but you
must save the second section (the comma delimited list) as
"docList.txt" because it's the source of the data and that name
is coded into the .html page.
--CUT 'N PASTE HTML--
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<!-- The following is the Tabular Data Control (tdc) that ships
with IE4.0. As such this will only work with IE4.0
-->
<OBJECT id="docList"
classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"
align="baseline" border="0" width="0" height="0">
<param name="DataURL" value="docList.txt">
<param name="UseHeader" value="True">
</OBJECT>
<!-- Define your table and dynamically fill the cells with the
items from the "DataURL" source, here "docList.txt"
-->
<TABLE border="1" id="tblDoc" datasrc="#docList">
<THEAD> <TR>
<TD><DIV id=docName><button
style="width:120;">Name</button></DIV></TD>
<TD><DIV id=docDate><button
style="width:120;">Date</button></DIV></TD>
<TD><DIV id=docSize><button style="width:120;">Size
(kb)</button></DIV></TD>
</TR>
</THEAD><TBODY> <TR>
<TD align=right><SPAN DATAFLD="docName"></SPAN></TD>
<TD align=right><DIV DATAFLD="docDate"></DIV></TD>
<TD align=right><SPAN DATAFLD="docSize"></SPAN></TD>
</tr>
</TBODY></TABLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Functions for sorting the columns -->
function srtName() {
docList.SortColumn = "docName";
docList.Reset();
}
docName.onclick = srtName;
function srtDate() {
docList.SortColumn = "docDate";
docList.Reset();
}
docDate.onclick = srtDate;
function srtSize() {
docList.SortColumn = "docSize";
docList.Reset();
}
docSize.onclick = srtSize;
</SCRIPT>
</BODY>
</HTML>
-- END HTML--
---CUT 'N PASTE TEXT--
docName:STRING,docDateATE,docSize:INT
index.html,03/01/1999,36
toc.html,11/20/1998,51
help.html,11/21/1998,24
source.html,10/15/1998,32
myStyle.css,12/16/1998,20
funct.js,01/16/1999,10
ie.js,02/16/1999,5
ns.js,02/17/1999,4
nav.gif,09/14/1997,22
rArrow.gif,03/12/1997,31
lArrow.gif,03/13/1997,34
--END OF TEXT FILE--
HTH
-Machi
<<<<<<<<<<<<<<<<<<<<<<<<
supplied by Machi, or know of a simple alternative
bob
Machi wrote Mar 10 1999, 8:00 am
....
Hello Harjinder!
Not sure if you had this in mind or not. This is an example of
data binding and sorting using the Tabular Data Control (tdc)
that ships with IE. Please note that this will only work with IE.
Copy each section. Save the first with any name you like, but you
must save the second section (the comma delimited list) as
"docList.txt" because it's the source of the data and that name
is coded into the .html page.
--CUT 'N PASTE HTML--
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<!-- The following is the Tabular Data Control (tdc) that ships
with IE4.0. As such this will only work with IE4.0
-->
<OBJECT id="docList"
classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"
align="baseline" border="0" width="0" height="0">
<param name="DataURL" value="docList.txt">
<param name="UseHeader" value="True">
</OBJECT>
<!-- Define your table and dynamically fill the cells with the
items from the "DataURL" source, here "docList.txt"
-->
<TABLE border="1" id="tblDoc" datasrc="#docList">
<THEAD> <TR>
<TD><DIV id=docName><button
style="width:120;">Name</button></DIV></TD>
<TD><DIV id=docDate><button
style="width:120;">Date</button></DIV></TD>
<TD><DIV id=docSize><button style="width:120;">Size
(kb)</button></DIV></TD>
</TR>
</THEAD><TBODY> <TR>
<TD align=right><SPAN DATAFLD="docName"></SPAN></TD>
<TD align=right><DIV DATAFLD="docDate"></DIV></TD>
<TD align=right><SPAN DATAFLD="docSize"></SPAN></TD>
</tr>
</TBODY></TABLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- Functions for sorting the columns -->
function srtName() {
docList.SortColumn = "docName";
docList.Reset();
}
docName.onclick = srtName;
function srtDate() {
docList.SortColumn = "docDate";
docList.Reset();
}
docDate.onclick = srtDate;
function srtSize() {
docList.SortColumn = "docSize";
docList.Reset();
}
docSize.onclick = srtSize;
</SCRIPT>
</BODY>
</HTML>
-- END HTML--
---CUT 'N PASTE TEXT--
docName:STRING,docDateATE,docSize:INT
index.html,03/01/1999,36
toc.html,11/20/1998,51
help.html,11/21/1998,24
source.html,10/15/1998,32
myStyle.css,12/16/1998,20
funct.js,01/16/1999,10
ie.js,02/16/1999,5
ns.js,02/17/1999,4
nav.gif,09/14/1997,22
rArrow.gif,03/12/1997,31
lArrow.gif,03/13/1997,34
--END OF TEXT FILE--
HTH
-Machi
<<<<<<<<<<<<<<<<<<<<<<<<