Forum


20:37

18/02/2010

I am trying to display jqgrid using json string. None of the pagination button works, Search does not work.
Nothing happens when i click on the search or next buttons. How does server side pagination work on jqgrid, Is it possible to do client side pagination and search. I am using Struts2 to do this.
<script src="<s:url value="/script/jquery/ui/ui.core.js"/>" type="text/javascript"></script><script src="<s:url value="/script/jquery/ui/jquery-ui-1.7.2.custom.js"/>" type="text/javascript"></script><script src="<s:url value="/script/jquery/jqgrid/jquery.jqGrid.min.js"/>" type="text/javascript"></script><script src="<s:url value="/script/jquery/i18n/grid.locale-en.js"/>" type="text/javascript"></script><script src="<s:url value="/script/jquery/datepicker/jquery.ui.datepicker.js"/>" type="text/javascript"></script><script src="<s:url value="/script/jquery/jquery-1.3.2.min.js"/>" type="text/javascript"></script>
$(document).ready(function(){
$("body").css("font-size", "10px");
initJQGridPage();
$("#list").setGridHeight(320,true);
});
function initJQGridPage() {
var transmittedLoanJsonStr=jQuery("#transmittedReportJSONData").attr('value');
jQuery("#list").jqGrid({
url:'<s:url value="fundreports/TransmittedLoan.action?currPage=%{currPage+1}"/>',
datatype: 'jsonstring',
datastr:transmittedLoanJsonStr,
colNames:['First Name', 'Last Name','Grade Level','Academic Period'],
colModel :[
{name:'First Name', index:'FirstName', width:80},
{name:'Last Name', index:'LastName', width:80},
{name:'Grade Level', index:'GradeLevel', width:100, sortable:false},
{name:'Academic Period', index:'AcademicPeriod', width:100, sortable:false},
],
rowNum:10,
rowList:[10,20,30,40,50],
pager: '#pager',
sortname: 'FirstName',
viewrecords: true,
sortorder: 'asc',
caption: 'Reports'
});
//jQuery("#list").navGrid("#pager",{refresh: false, edit: false, add: false, del: false, search: true})
}
23:20

10/08/2009

Hi!
jqGrid automatically append Url from "url" option of jqGrid with additional parameters "page", "rows", "sidx", "sord" and sometimes more depend on the context, so the request to server looks like myurl.php?page=1&rows=10&sidx=myindex&sord=asc (where myurl.php is like "fundreports/TransmittedLoan.action" in your case). Your server should of cause send back corresponding data based on this additional parameters. Searching of data works in the same way.
For more information read /jqgridwiki and example of PHP server code on /jqgridwiki/doku.php?id=wiki:first_grid).
Best regards
Oleg
00:11

10/08/2009

Good question! I could recommend Fiddler (http://www.fiddler2.com/fiddler2/) and Firebug (http://getfirebug.com/). There are plugins for different Browsers from this tools.
Regards
Oleg
Most Users Ever Online: 715
Currently Online:
69 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66