Forum


22:43

24/07/2009

hi there, I'm hoping someone can help me with this, it should be a useful feature for others as well. I am generating a grid which has a 'country' column. however, it takes up some space so I was hoping I might instead use a set of tiny flags like these ones:
basically, the images are all named after their internet codes which are kept in the database, it is quite simple to auto-generate the path of the correct flag image. The question is, how do I implement this into a jqGrid?
thanks in advance
00:28

13/06/2009

Hi,
If you look at the javascript in this example...
http://www.thekmz.co.uk/GEPlug.....dtest2.htm
...it demostrates 2 methods I've used in the past.
Col1 is done by setting the image using setcell after the grid has loaded.
Col2 is done by using the formatter which is the method I now use and is probably cleaner. In my case if the value in the cell=1 show the image - if it's 0 don't. The same principle would work with country codes.
However if you want to do it within your data, as opposed to with a format, then method 1 gives an idea of the format of the cell contents you'd need.
(Ignore the other stuff in there - that's just there to switch between show/hide image when clicking on the cells)
Hope that helps a bit - you'll probably need something slightly different but the basic idea is there I think.
Regards
Romyn
Most Users Ever Online: 715
Currently Online:
175 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