Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Has anyone got any sample code of using jqgrid with JSPs or Spring?
Posted 24-Jan-10 6:35am
Dorr67292
Edited 24-Jan-10 7:16am
fly90410K
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
Your Filters
Interested
Ignored
     
0 Guruprasad.K.Basavaraju 460
1 Sergey Alexandrovich Kryukov 336
2 Shai Vashdi 294
3 OriginalGriff 280
4 Abhinav S 160
0 Sergey Alexandrovich Kryukov 9,185
1 OriginalGriff 5,315
2 Peter Leow 4,040
3 Maciej Los 3,535
4 Abhinav S 3,308


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