带有JSP或Spring的JQGrid? [英] JQGrid with JSPs or Spring?
本文介绍了带有JSP或Spring的JQGrid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道将jqgrid与JSP或Spring一起使用的示例代码吗?
Has anyone got any sample code of using jqgrid with JSPs or Spring?
推荐答案
仅从此处 [ ^ ]?
只需编写JSP即可完成PHP的工作.
What''s wrong with just changing the PHP examples from here[^]?
Just write your JSP to do what the PHP is doing.
我已经显示了网格,但是它没有读取我的数据.不知道我在想什么.这是我的html和xml:
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>
Dorr67写道:
< ; script src ="C:/jqgrid_test/jquery_theme/js/jquery-1.3.2.min.js" type ="text/javascript"></script>
<script src="C:/jqgrid_test/jquery_theme/js/jquery-1.3.2.min.js" type="text/javascript"></script>
我不认为静态引用主要用于安全性.使用相对引用,例如jquery-1.3.2.min.js
在名为js
的文件夹中,而上面目录中的调用HTML为:
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>
这篇关于带有JSP或Spring的JQGrid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文