开发者

Where are the supporting files for the jqGrid tutorial example?

I am trying to follow the jqGrid tutorial at http://www.secondpersonplural.ca/jqgriddocs/index.htm.

On the page "The HTML" under the "Creating your first grid" section, they give a sample webpage.

<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:'example.php',
    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> 
</head> 
<body> 
<table id="list" class="scroll"></table> 
<div id="pager" class="scroll" style="text-align:center;"></div> 
</body> 
</html> 

When I load that page, after loading jQuery, unpacking a full installation of jqGrid, and unpacking a (default full) theme from Themeroller (and moving开发者_如何学运维 the contents of development-bundle/ to the parent directory with everything else), I get a blank page.

Poking around a bit, I see some supporting files but not others. The HTML pulls js/jqModal.js and themes/jqModal.css, for instance. I have jqModal.js in place, but jqModal.css is a 404 and I haven't yet succeeded in finding where to pull it from.

I think the blank page is because it is pulling from a nonexistent source (would be nicer if the docs gave a sample XML file instead of giving directives to build the XML on the server side), but I'd be interested in sample XML and in the files that I'm missing.

Where can I get files like jqModal.css and themes/basic/grid.css that it seems to want? Is there sample XML that I can use before I've built stuff on the server to build the XML data file?

--Edit--

I changed the data URL from 'example.php' to 'example.xml', and saved there the following:

<?xml version ="1.0" encoding="utf-8"?> 
<rows> 
  <page>1</page> 
  <total>2</total> 
  <records>2</records> 
    <row id = "1"> 
      <cell> cellcontent </cell> 
      <cell> <![CDATA[<font color=”red”>cell</font> content]]> </cell> 
    </row> 
    <row id = "2"> 
      <cell> cellcontent </cell> 
      <cell> <![CDATA[<font color=”red”>cell</font> content]]> </cell> 
    </row> 
</rows> 

(The documentation gave sample XML with smartquotes, but replacing the smartquotes with standard quotes did not alter the behavior.)

I still get a blank page. (As well as Chrome, I checked it out in Firefox and IE: still just a blank page, with a title but nothing else visible.)


I think the tutorial based on an example which you can download from the mainpage of jGrid. Try to download the demo Demo files for 3.4.x that contains the css files. The zip file should contains the nesseacary javasctipt files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜