Page 1 of 1

[HTA] Sorting Table

Posted: Mon Nov 25, 2013 10:16 pm
by hackoo
Hello,
I have a JS that allows you to sort the columns in my table (ASC, DESC).
http://www.kryogenix.org/code/browser/s ... rttable.js
It works if I do the classic html, I can sort my columns generated statically.
VBScript Code
Double-click the code block to select all.
<html>
<script type="text/javascript" src="sorttable.js"></script>
 <table class = 'sortable'><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td> </tr><tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td></tr></table>
 <body>
<span id = "oDivDisplayArea"></span></br>
</body>
</html>
However, if now I want to sort my table generated in vbs it no longer My table is displayed but becomes static, I can not use the arrows that allow you to sort my columns works.
If you have an idea, I'm interested.
VBScript Code
Double-click the code block to select all.
<html>
<script type="text/javascript" src="sorttable.js"></script>
<script language="VBScript">
Sub window_Onload
	oDivDisplayArea.innerHTML = "<table class = 'sortable'><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><tr><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td> </tr><tr><td>11</td><td>12</td><td>13</td><td>14</td><td>15</td></tr></table>"
End sub	
</script>
<body>
<span id = "oDivDisplayArea"></span></br>
</body>
</html>
Thank you in advance !

Re: [HTA] Sorting Table

Posted: Mon Nov 25, 2013 10:48 pm
by jvierra
You have to build the table as an object using createElement.

Sometimes a page refresh will work. Depends on the browser version.

Re: [HTA] Sorting Table

Posted: Tue Nov 26, 2013 8:02 am
by jvierra
Try this version in an attached file.

Re: [HTA] Sorting Table

Posted: Sat Dec 07, 2013 7:39 am
by hackoo
Thank you for sharing this helpful code ;)