Forum

July 12th, 2025
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
Custom pager
31/03/2010
11:32
Avatar
gowger
Member
Members
Forum Posts: 6
Member Since:
31/03/2010
sp_UserOfflineSmall Offline

Hi 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

<a class="btn" onclick="onPaging('next')">Next</a>

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!

31/03/2010
11:54
Avatar
gowger
Member
Members
Forum Posts: 6
Member Since:
31/03/2010
sp_UserOfflineSmall Offline

Ok i found one dumb mistake!

jQuery.('#gridtable').trigger("reloadGrid");

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.

jQuery('#gridtable').trigger("reloadGrid");

but I haven't managed to setGridParam  yet.

31/03/2010
14:52
Avatar
gowger
Member
Members
Forum Posts: 6
Member Since:
31/03/2010
sp_UserOfflineSmall Offline

Ok I got it working using this function attached to onclick of my buttons. Apologies for the spurious post.

        function loadPage(thePage) {
            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

$('#gridtable').jqGrid.getGridParam("url");

or

jQuery("#gridtable").getGridParam('url')
03/04/2010
15:57
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

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.

26/04/2010
14:40
Avatar
gowger
Member
Members
Forum Posts: 6
Member Since:
31/03/2010
sp_UserOfflineSmall Offline

Hi 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!

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information