Forum


17:34

03/12/2010

Hi all
I'd like to format a column cell as a link
I've already read this wiki page : http://www.trirand.com/jqgridw.....showaction
but there are only examples such as
http://localhost/someurl.php?m.....ction=edit
In my case, I use url-rewriting and I have to format links that look like :
http://localhost/someurl/123/edit
As I don't have an example that fits well, I tried somethings using jqGridRender::setColProperty()
but nothing works as expected.
Is there a way I can do that with jqGridRender (either server-side or client-side) ?
Thank you.
00:41

10/08/2009

Hello Joris,
The predefined formatter showlink is not perfect. It is very easy to write your own custom formatter which produce exact HTML code fragment for the link format which you need.
In both cases the function which you can call in the way must be global. If you prefer concept of unobtrusive JavaScript you can use predefined formatter showlink with '#' as the value of href attribute and make binding to the click on the link inside of loadComplete function. I created small demo example which demonstrate the technique. On the click on the text like "Physics" in the table will be opened the url http://en.wikipedia.org/wiki/Physics which will be build dynamical. I included an additional alert to show how to decode information about the row id additionally.
Best regards
Oleg
Most Users Ever Online: 715
Currently Online:
82 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