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_Related Related Topics sp_TopicIcon
idPrefix Option: Prefix is included as part of ID with showlink formatter
04/12/2012
00:31
Avatar
Inara
Member
Members
Forum Posts: 26
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

I recently started trying to use the idPrefix option for grids to avoid duplicate row IDs, but I found that it breaks the predefined showlink formatter, since the prefix isn't stripped off of the ID before being appended to the URL. (For example, if I have a row with ID 3 and an idPrefix of 'Event_', the url gets "id=Event_3" appended to it, instead of the desired "id=3".) Does anyone have a solution (or even a temporary workaround) for this issue?

04/12/2012
10:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for this. Fixed in GitHub. Please let me know if everthing is working fine.

Kind Regards

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/12/2012
18:52
Avatar
Inara
Member
Members
Forum Posts: 26
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

Thanks for getting to this so quickly, Tony. I had one other question (which I supppose is more of a feature request than a bug, if it's not already possible): Is there any way to pass a data/column value other than the row ID with the showLink formatter, or would I need to create a custom formatter for that?

05/12/2012
10:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You can use addParam to add additional parameter.

See docs here

Regards

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.

05/12/2012
11:13
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Correction - sorry. You will need to use a custom formatter in your case.

Regards

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.

05/12/2012
13:17
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

@Inara: You can use dynamicLink formatter if you want. See the answer and this one for the code examples. If you would include jQuery.jqGrid.dynamicLink.js file (which you can download from github) after jqGrid JavaScript files you can use formatter: "dynamicLink". So the usage of the formatter dynamicLink is exactly so simple as the usage of any predefined formatter like formatter: "showlink".

@Tony: If you want you can add the formatter to the code of jqGrid.

Best regards
Oleg 

05/12/2012
18:23
Avatar
Inara
Member
Members
Forum Posts: 26
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

Thanks, Oleg. I'll definitely look into your plugin; it looks like it may be exactly what I need. I appreciate both of your responses.

12/02/2013
21:15
Avatar
Inara
Member
Members
Forum Posts: 26
Member Since:
27/07/2009
sp_UserOfflineSmall Offline

I just ran across one further issue with the idPrefix option: The getDataIDs method has no option for excluding the prefix. It's not the end of the world, since I can write a manual workaround each time I call getDataIDs, but it's still an easy way to get tripped up in coding. Would it be possible to add a parameter to the getDataIDs function to get the IDs back sans prefix (or just make that the default, if there are no real use-case scenarios for including the prefix)?

EDIT: After experimenting more, I found that this issue is actually more of a general problem with all of the grid methods relating to row IDs. Most of them still expect to receive the row ID including the prefix for a parameter, and return the row ID including prefix as a result (where applicable). I can still write workarounds where necessary, but it makes the idPrefix attribute difficult to work with if you're building anything other than a very basic grid.

Thanks,

Inara

13/02/2013
15:14
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thank you for yor investigations.

Any help is greatly appreciated.

Kind Regards

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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