Forum


16:19

13/11/2008

Hi,
I took the example posted here : http://www.trirand.com/blog/?p.....rid/page-1
but, despite the advices ... no data shown in the grid.
I certainly make a mistake somewhere ... but I can't find it !
The main HTML file :
<html>
<head>
<meta http-equiv="Content-Type" content="text/xml" charset=utf-8" />
<title>jqGrid Demo</title>
<link rel="stylesheet" type="text/css" media="screen" href="include/themes/basic/grid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="include/themes/jqModal.css" />
<script src="include/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="include/jquery.js" type="text/javascript"></script>
<script src="include/jquery.jqGrid.js" type="text/javascript"></script>
<script src="include/js/jqModal.js" type="text/javascript"></script>
<script src="include/js/jqDnR.js" type="text/javascript"></script>
<script type="text/javascript" type="text/xml">
$(document).ready(function() {
$("#list").jqGrid({
url: "test2.xml",
mType: 'GET',
colNames: ['Num', 'First Name', 'Surname'],
colModel: [
{ name: 'num,', index: 'num', width: 55, resizable: true, xmlmap: "contactId" },
{ name: 'name', index: 'name', width: 90, resizable: true, xmlmap: "firstName" },
{ name: 'surname', index: 'surname', width: 120, resizable: true, xmlmap: "lastName" }
],
datatype: 'xml',
viewrecords: true,
pager: $('#pager'),
rowNum: 10,
rowList: [5, 10, 15],
sortname: 'num',
sortorder: 'desc',
multiselect: true,
multikey: "ctrlKey",
caption: 'My first grid',
imgpath: "include/themes/basic/images",
xmlReader: {
root: "contacts",
row: "contact",
page: "contacts>page",
total: "contacts>total",
records: "contacts>records",
repeatitems: false
}
});
});
</script>
</head>
<body>
<table id="list" class="scroll" border="1" width="200px"></table>
<div id="pager" class="scroll" style="text-align:center;"></div>
</body>
</html>
The XML file (located in the web server's root directory) :
<?xml version="1.0" encoding="utf-8"?>
<contacts>
<page>1</page>
<total>2</total>
<records>2</records>
<contact>
<contactId>2</contactId>
<firstName>Barry</firstName>
<lastName>Gottshall</lastName>
</contact>
<contact>
<contactId>3</contactId>
<firstName>Armando</firstName>
<lastName>Valdes</lastName>
</contact>
</contacts>
Suite :
I noticed in Firebug that :
$ -> jgrid -> errors :
errcap : "Error"
norecords : "Norecords to process"
nourl : "No url is set
but I mentionned it in the html/script :
url: "test2.xml"
Any idea ?
FYI :
latest versions downloaded for jquery and jqgrid ...
setmod is 0777 for all directories/files
Thanks in advance for your precious advices ... and forgive the bad quality of my english
:>)
direct email : pierre@prmartin.net
06:53

Moderators
30/10/2007

Hello,
Is that your full script?
Also check with xmlstring and do not use server.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
52 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