Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Has anyone got any sample code of using jqgrid with JSPs or Spring?
Posted
Updated 24-Jan-10 7:16am
v2

What's wrong with just changing the PHP examples from here[^]?

Just write your JSP to do what the PHP is doing.
 
Share this answer
 
I've got the grid displaying but it's not reading my data. Not sure what I'm missing. Here's my html and xml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<link rel="stylesheet" type="text/css" media="screen" href="C:/jqgrid_test/jquery_theme/css/ui-lightness/jquery-ui-1.7.2.custom.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="C:/jqgrid_test/jqgrid/css/ui.jqgrid.css" />	
		<link rel="stylesheet" type="text/css" media="screen" href="C:/jqgrid_test/jqgrid/src/css/ui.multiselect.css" /> 
		
		<script src="C:/jqgrid_test/jquery_theme/js/jquery-1.3.2.min.js" type="text/javascript"></script>
		<script src="C:/jqgrid_test/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
		<script src="C:/jqgrid_test/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>		
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<script>			
		jQuery(document).ready(function(){ 
  			jQuery("#stateList").jqGrid({
    			url:'C:\jqgrid_test\state.xml',                
    			datatype: 'xml',
    			mtype: 'GET',
    			colNames:['State Id','State Code','State Name'],
    			colModel :[ 
      				{name:'stateId', index:'stateId', width:70}, 
      				{name:'stateCde', index:'stateCde', width:100}, 
      				{name:'stateNameTxt', index:'stateNameTxt', width:300, align:'right'},       
    			],                 
    			pager: jQuery('#pager'),
    			rowNum:10,
    			rowList:[10,20,30],
   	 		sortname: 'stateId',
    			sortorder: 'desc',
    			viewrecords: true,			
    			caption: 'State List'
  			}); 
		}); 		
	</script>					
	</head>
	<body>
		<table id='stateList' class='scroll'></table> 
		<div id='pager' class='scroll' style='text-align:center;'></div> 
	</body>
</html>
<?xml version='1.0' encoding = 'utf-8'?>
<rows>
  <page>1</page>
  <total>2</total>
  <records>2 </records>    
  <row id = "1">
    <cell>1</cell>
    <cell>GA</cell>
    <cell>Georgia</cell>
  </row>
  <row id = "2">
    <cell>2</cell>
    <cell>FL</cell>
    <cell>Florida</cell>
  </row>	
</rows>
 
Share this answer
 
v3
Dorr67 wrote:
<script src="C:/jqgrid_test/jquery_theme/js/jquery-1.3.2.min.js" type="text/javascript"></script>


I don't believe static references work, mainly for security. Use relative references such as if jquery-1.3.2.min.js was in a folder called js, with the calling HTML in the directory above would be:
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
 
Share this answer
 
v4
I've got it working in Chrome, but it's not displaying my data in IE.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900