jquery datatables using classic .asp
I am trying to get the jquery datatabl开发者_如何转开发es plugin pulling data using VBScript instead of PHP as shown on their website. Has anybody any advice on where to start or maybe seen this already implemented somewhere else?
Any assistance would be great!
I'm not sure how familiar you are with the javascript grid/ajax model, so here is an outline:
1) you have an (X)HTML page that includes a table (which might be rendered by classic asp):
<table id="tableIDhere">
<thead>
<tr>
<th>Rendering engine</th>
<th>Browser</th>
<th>Platform(s)</th>
<th>Engine version</th>
<th>CSS grade</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="5" class="dataTables_empty">Loading data from server</td>
</tr>
</tbody>
</table>
2) you then make a jQuery call to enhance the table with the behaviour expected of a datagrid
$(document).ready(function() {
$('#tableIDhere').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../name_of_your_asp_page.asp"
} );
} );
3) when the jquery datagrid has initialised, it will make a call to your classic asp page (../name_of_your_asp_page.asp) expecting a specific format of data to be consumed by the datagrid
{"sEcho": 3,
"iTotalRecords": 57,
"iTotalDisplayRecords": 57,
"aaData": [
["Other browsers","All others","-","-","U"],
["Misc","NetFront 3.1","Embedded devices","-","C"],
["Misc","NetFront 3.4","Embedded devices","-","A"]
]
}
I'm not sure how you interact with a database normally (Through stored procedures/scripted SQL etc), if you're not sure I would start by looking at using a library like the ajaxed asp library - this should give you a flying start.
Hope this helps you make a start
精彩评论