Tagi na forum.

Windows 14205 SQL Server 2132
sieci 6796 Windows XP 1921
SQL 6578 Outlook 1838
SBS 3868 Uprawnienia 1777
Windows 2003 2781 IIS 1636
Windows Server 2588 Office 1516
DNS 2315 Skrypt 1499

pokaż wszystkie tagi na forum

ASP VB SCRIPT i datatable

pardi 2011-05-04 08:51:54
0
avatar
 
 
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>





 
 
tagi: jQuery   mysql

MCITP, MCSE+Sec, CCNA,



jak0b  2011-05-04 10:54:09 #1
0
avatar
 
 
Kod VB działa po stronie serwera. Kod js po stronie klienta, na już gotowym dokumencie html.
Ale jak się generuje błędną strukturę tabeli html to tak się ma. Znacznik tbody wywał poza pętlę.--If the facts don't fit the theory, change the facts.

If the facts don't fit the theory, change the facts.
pardi  2011-05-04 11:05:12 #1.1
0
avatar
 
 
Probowalem wszystko... nie pomyslalem zeby <tbody> za </thead>
Dziala!!
Dzieki wielkie!!!
 

MCITP, MCSE+Sec, CCNA,

Udziel odpowiedzi

avatar
Treść wpisu:

Zaloguj się lub Zarejestruj się aby wykonać tę czynność.

Idź na górę strony