Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript Java jQuery
Has anyone got any sample code of using jqgrid with JSPs or Spring?
Posted 24-Jan-10 7:35am
Dorr67292
Edited 24-Jan-10 8:16am
fly90410.2K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

What's wrong with just changing the PHP examples from here[^]?
 
Just write your JSP to do what the PHP is doing.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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>
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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>
  Permalink  
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

I've got it working in Chrome, but it's not displaying my data in IE.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 539
1 Maciej Los 300
2 DamithSL 233
3 Sergey Alexandrovich Kryukov 209
4 BillWoodruff 200
0 OriginalGriff 7,168
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,461
3 Manas Bhardwaj 4,876
4 Maciej Los 4,450


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 25 Jan 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100