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
Select editoptions displaying value instead of name
19/03/2010
22:39
Avatar
ColinKahn
Member
Members
Forum Posts: 3
Member Since:
19/03/2010
sp_UserOfflineSmall Offline

Hi,

I'm using an edittype:select with editoptions{value:'0:Op1;1:Op2'} and when grid data is loaded it will display '0', '1', instead of 'Op1', 'Op2'. It will only display the name if I edit the cell. When I add a new row it correctly displays the drop down, but once it reloads the grid it will display the '0'/'1' values instead of the names.

Any suggestions?

20/03/2010
01:08
Avatar
tim
Calgary Alberta Canada
Member
Members
Forum Posts: 61
Member Since:
04/11/2009
sp_UserOfflineSmall Offline

My guess is that you are storing 0 & 1 as the actual value in your database, and your 'dataurl' webservice is not translating 0 & 1 to their respective display values. When you look at the raw data what's initially being fed into your grid? 0 or Op1?

tim

20/03/2010
01:36
Avatar
ColinKahn
Member
Members
Forum Posts: 3
Member Since:
19/03/2010
sp_UserOfflineSmall Offline

You're exactly right, the database sends 0 and 1, not the name. But if what you're saying is that it should send 'Op1' what's the point of having value/name pairs when all you're really working with is names?

20/03/2010
02:41
Avatar
tim
Calgary Alberta Canada
Member
Members
Forum Posts: 61
Member Since:
04/11/2009
sp_UserOfflineSmall Offline

good question ;)

I am guessing that Tony expects people store the display value in the database for ease when using the search text entered, when I (like you) would rather store the key and have jqGrid translate the display on the client side and let us write code to translate the 'Search Text' back to the key value for look up. Maybe Tony can add an option to handle both ?

tim

20/03/2010
10:33
Avatar
ColinKahn
Member
Members
Forum Posts: 3
Member Since:
19/03/2010
sp_UserOfflineSmall Offline

Ah, I see what you're saying about the search text. It really seems like a bug, to me though. If you send it values from the DB, and then edit the post, it will show you the name when your finished editing it. It's like some kind of event is triggering that subs the value for the name, but that trigger is only happening after you edit the post.

I guess if there's no known work around for now I could digg around with Firebug...

04/04/2010
15:34
Avatar
mzazzali
Member
Members
Forum Posts: 3
Member Since:
04/04/2010
sp_UserOfflineSmall Offline

I was looking for the same thing and I ended up hacking the jqgrid code to get it to show the value instead of the id.  However I just came across this post which seems to be the real solution.  I haven't tried it yet but it seems to be what both of us were looking for.

/blog/?page_id=393/help/select-boxes-view-in-grid/&value=select%20value&type=1&include=1&search=1&ret=all

08/04/2010
12:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Yes - formatter select is your solution. It is good first to search the docs Wink

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

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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