Forum
Topic RSS
11:32
31/03/2010
OfflineHi folks,
I've been using jqGrid via the struts plugin and i'm very impressed by the feature set and how quickly you get some great results. Unfortunately though my clients are sticklers about their design and don't want the pager buttons as they come with jqGrid and have quite a different design in mind.
I know this is probably very easy and a real n00b question but I'm under a lot of time pressure and so haven't quite understood yet how to do this. All I need to know is what function I need to attach to my buttons onclick events to do the paging. I've tried using this
and this in a function:
function loadPage() {
jQuery.('#gridtable').setGridParam({url:'jsontable?accountid=15&_=1269961651042&_search=false&nd=1269961651042&rows=10&page=2&sidx=&sord=asc'});
jQuery.('#gridtable').trigger("reloadGrid");
}
<a class="btn" onclick="loadPage()">Next</a>
but no ajax event is fired. I get a "XML filter is applied to non-XML value" when I try this. I'm using a JSON data source.
Any pointers are greatly appreciated!
11:54
31/03/2010
OfflineOk i found one dumb mistake!
should be (no dot!) I also found that the $('#gridtable'). .... version sisn't work, not sure why. too new to jquery. Maybe to do with the version included with the struts plugin.
but I haven't managed to setGridParam yet.
14:52
31/03/2010
OfflineOk I got it working using this function attached to onclick of my buttons. Apologies for the spurious post.
jQuery("#gridtable").jqGrid('setGridParam', {
page: thePage
}).trigger("reloadGrid")
}
But now I keep getting a $t is undefined when I try to retrieve any of the variables for the pages or anything else for that matter using
or
15:57
Moderators
30/10/2007
OfflineHello,
Maybe you can do this:
$('#gridtable').jqGrid('getGridParam','url');
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
14:40
31/03/2010
OfflineHi Tony,
With the struts plugin I'm using I had to give up on that approach and only use the jqgrid variables in click events because it uses the document.ready to load the grid. I ended up doing a bit of server side work to get the pages numbers for scripts. It's an extra server side count but it's not the worst case.
Thanks for your help!
Most Users Ever Online: 994
Currently Online:
17 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
Log In
Home