Forum


14:29

14/11/2008

Hi All,
I would just like to say this bit of 'kit' is fantastic!!!
I am a NOOB unfortunately and have just tried to do complete the XML demo in the documentation.
What my issue is, is that I have to click a header to populate the grid with the database data. I cannot see why it doesn't load the data when you load the page.
Can anyone point me in the right direct.
Thanks,
Matt.
HTML Code for reference:
<html>
<head>
<title>jqGrid Demo</title>
<link rel="stylesheet" type="text/css" media="screen" href="themes/basic/grid.css">
<link rel="stylesheet" type="text/css" media="screen" href="themes/jqModal.css">
<script src="jquery.js" type="text/javascript">
</script>
<script src="jquery.jqGrid.js" type="text/javascript">
</script>
<script src="js/jqModal.js" type="text/javascript">
</script>
<script src="js/jqDnR.js" type="text/javascript">
</script>
<script type="text/javascript">
jQuery(document).ready(function(){ jQuery("#list").jqGrid({ url:'example1_server.php?nd='+new Date().getTime(), datatype: 'xml', mtype: 'GET', colNames:['Inv No','Date', 'Amount','Tax','Total','Notes'], colModel :[ {name:'invid', index:'invid', width:55}, {name:'invdate', index:'invdate', 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: jQuery('#pager'), rowNum:10, rowList:[10,20,30], sortname: 'id', sortorder: "desc", viewrecords: true, imgpath: 'themes/basic/images', caption: 'My first grid' }); });
</script>
<style type="text/css">
div.c1 {text-align:center;}
</style>
</head>
<body>
<table id="list" class="scroll"></table>
<div id="pager" class="scroll"></div>
</body>
</html>
Most Users Ever Online: 715
Currently Online:
42 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66