Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Pagination, Search does not work. Please help
18/02/2010
20:37
Avatar
merchant
USA
Member
Members
Forum Posts: 3
Member Since:
18/02/2010
sp_UserOfflineSmall Offline

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})

}

18/02/2010
22:08
Avatar
merchant
USA
Member
Members
Forum Posts: 3
Member Since:
18/02/2010
sp_UserOfflineSmall Offline

Is the pagination suppose to work automagically or do I have to add an event for each of the first, next, last, previous buttons and provide a url that will submit a form and fetch the data. 

18/02/2010
23:20
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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

18/02/2010
23:50
Avatar
merchant
USA
Member
Members
Forum Posts: 3
Member Since:
18/02/2010
sp_UserOfflineSmall Offline

Thanks for the response, is there a way I can find what URL is being called in order to debug. 

Thanks

19/02/2010
00:11
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information