Reputation: 2388
Learning Jquery here and I would like to show my SQL table on my webpage. I have the "shell" of my jquery that matches the SQL table and my web.config is setup correctly but my jquery doesnt load data. Where it says url: 'ConnectionString',
I would like for it to point to my table or the web.config file. What can I do here. I need some guidance as this is something Im learning.
Thanks
<script type='text/javascript'>
$(function () {
$("#list").jqGrid({
url: 'Default.aspx',
datatype: 'xml',
mtype: 'GET',
colNames: ['Inv No', 'Date', 'Amount', 'Tax', 'Total', 'Notes'],
colModel: [
{ name: 'ID', index: 'ID', width: 55 },
{ name: 'Date', index: 'Date', width: 90 },
{ name: 'amount', index: 'amount', width: 80, align: 'right' },
{ name: 'tax', index: 'tax', width: 80, align: 'right' },
{ name: 'total', index: 'total', width: 80, align: 'right' },
{ name: 'note', index: 'note', width: 150, sortable: false }
],
pager: '#pager',
rowNum: 10,
rowList: [10, 20, 30],
sortname: 'invid',
sortorder: 'desc',
viewrecords: true,
caption: 'Joshs first grid'
});
});
</script>
My Aspx part as follows
<div class="ui-widget">
<table id="list"></table>
<div id="pager"></div>
</div>
Upvotes: 0
Views: 992
Reputation: 24606
You seem to have a misunderstanding of how jQGrid works. It does not talk directly to your database at any point and it makes use of (optional) server-side libraries to format the response your server sends when the plugin requests data.
Please take a look at http://www.trirand.net/demoaspnet.aspx for an example of using jQGrid with ASP.NET.
Upvotes: 1