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
Help with getGridParam
28/04/2009
10:35
Avatar
Jim P
Member
Members
Forum Posts: 102
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Tony,

I'm trying to pass the value [name] of the current sort column in a url stream of the pager.    See bold text below.

I'm using Cold Fusion.  My url parameters on the input to ExportTo.cfm page show that sidx = sortCol.

how can I pass the value of sortCol ?

thanks,  Jim

   $("#agelist").navGrid("#agepager2",{edit:false,add:false,del:false,search:false,refresh:false,position:"right"}).navButtonAdd('#agepager2',{caption:"To PDF", buttonimg:"images/pdf.png", onClickButton:
    function()
    {  
     var sortCol = $("#agelist").getGridParam("sortname");
     document.location.href='ExportTo.cfm?typ=p&met=DumpAGE&myacct=<cfoutput>#session.bizorg_objid#</cfoutput>&listtyp=age&sidx=+sortCol';
     },
    position:"last", title:'Export to PDF' }).navButtonAdd('#agepager2',{caption:"To Excel", buttonimg:"images/icon-xls.png", onClickButton: function(){document.location.href='ExportTo.cfm?typ=e&met=DumpAGE&myacct=<cfoutput>#session.bizorg_objid#</cfoutput>&listtyp=age';}, position:"last", title:'Export to Excel' })
    ;

28/04/2009
10:39
Avatar
Jim P
Member
Members
Forum Posts: 102
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Tony,

Part of my bold code was cut off.

   $("#agelist").navGrid("#agepager2",{edit:false,add:false,del:false,search:false,refresh:false,position:"right"}).navButtonAdd('#agepager2',{caption:"To PDF", buttonimg:"images/pdf.png", onClickButton:
    function()
    {  
     var sortCol = $("#agelist").getGridParam("sortname");
     document.location.href='ExportTo.cfm?typ=p&met=DumpAGE&myacct=<cfoutput>#session.bizorg_objid#</cfoutput>

&listtyp=age&sidx=+sortCol';
     },
    position:"last", title:'Export to PDF' }).navButtonAdd('#agepager2',{caption:"To Excel", buttonimg:"images/icon-xls.png", onClickButton: function(){document.location.href='ExportTo.cfm?typ=e&met=DumpAGE&myacct=<cfoutput>#session.bizorg_objid#</cfoutput>&listtyp=age';}, position:"last", title:'Export to Excel' })
    ; 

29/04/2009
15:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Sorry but I do not understand what you mean.

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.

04/05/2009
15:11
Avatar
Jim P
Member
Members
Forum Posts: 102
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Tony,

In my pager for my grid, I have links to dump the grid to pdf or excel.  To do this I link to a coldfusion page (Export.cfm and passing the parameters I need to recreate the grid query)  I want to pass the grids current sort parameters (name and order).  I'm trying to use the .getGridParam method.

Is there another way to do this?

thanks, Jim

05/05/2009
09:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

After this line

var sortCol = $(”#agelist”).getGridParam(”sortname”);

if you have make alert(sortCol) what is the result.

Maybe you should check you code sidx=+sortCol - what is sidx - from where you have this value? What you expect from this expression. IMHO it will not work

Try first to construct you string and after that make the link.

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.

06/05/2009
09:38
Avatar
Jim P
Member
Members
Forum Posts: 102
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

Tony,

Thanks for the pointer.

The value of sortCol in the alert() is the name of the current column selected as the sort.  Which is what I expect it to be.

When I test the value of  the URL that I pass, the value of sidx (just a url var) is:  sortCol  - not the value of sortCol.

How can I get the value of sortCol into this:

document.location.href='ExportTo.cfm?typ=p&met=DumpAGE&sidx=+sortCol';

06/05/2009
09:48
Avatar
Jim P
Member
Members
Forum Posts: 102
Member Since:
29/01/2009
sp_UserOfflineSmall Offline

I stumpled on the solution:

document.location.href='ExportTo.cfm?typ=p&met=DumpAGE&sidx='+sortCol;

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
90 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