Witam,
Probuje odpalic stone w asp z vbscriptem razem z datatables http://datatables.net
Nie mam pojecia co jest zle i dlaczego to nie chce dzialac. Datatable bazuje na jquery i z tego co wyczytalem wyszykuje tagi od table TH TD etc. Jesli strona jest statyczna i tabela jest zakodowana na "sztywno" to wszystko dziala. Problem jest w momencie kiedy tabela jest generowana dynamicznie uzywajac query z MS SQL. Wyglada na to ze datatables ma problem z vbscriptowym loopem.
Ponizej zalanczam moj kod strony.
Bylbym wdzieczny za jakamkolwiek pomoc.
Pozdrawiam,
Piotr
[Kod]
<head>
<title>DataTables example</title>
<style type="text/css" title="currentStyle">
@import "demo_page.css";
@import "demo_table.css";
</style>
<script type="text/javascript" language="javascript" src="jquery.js"></script>
<script type="text/javascript" language="javascript" src="jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('table').dataTable( {
"aaSorting": [[ 4, "desc" ]]
} );
} );
</script>
</head>
<body>
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=SQLOLEDB; Data Source=xxxxxxxx; Initial Catalog=xxxxxx; User ID=xxxxxx; Password=xxxxxxxx"
objConn.Open
DIM mySQL
mySQL = "SELECT * FROM data_table"
DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open mySQL, objConn
%>
table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
<thead>
<tr>
<th>Server</th>
<th>Tag</th>
<th>OS</th>
<th>Model</th>
<th>Memory</th>
</tr>
</thead>
<% DO WHILE NOT objRS.EOF %>
<tbody>
<tr class="gradea">
<td><% Response.Write objRS("server") %></td>
<td><% Response.Write objRS("tag") %></td>
<td><% Response.Write objRS("os") %></td>
<td><% Response.Write objRS("model") %></td>
<td><% Response.Write objRS("memory") %></td>
</tr>
</tbody>
<%
objRS.MoveNext
Loop
%>
</table>
</BODY>
<%
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
</HTML>