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
flag icons in row
02/08/2009
22:43
Avatar
highrise
Member
Members
Forum Posts: 19
Member Since:
24/07/2009
sp_UserOfflineSmall Offline

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

03/08/2009
00:28
Avatar
Romyn
Member
Members
Forum Posts: 45
Member Since:
13/06/2009
sp_UserOfflineSmall Offline

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

03/08/2009
00:32
Avatar
highrise
Member
Members
Forum Posts: 19
Member Since:
24/07/2009
sp_UserOfflineSmall Offline

thank you! I will try this out and if I get it working I will post it here for the community

Forum Timezone: Europe/Sofia

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

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information