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
inline editing with select
01/02/2010
20:12
Avatar
cmarino
New Jersey
New Member
Members
Forum Posts: 1
Member Since:
01/02/2010
sp_UserOfflineSmall Offline

Hi All,

I'm fairly new to jqGrid.   I have a simple question and it can be applied to the input types example in row editing seciton in this url http://www.triarand.com/blog/j..... 

There seems to be a disconnect in my understanding of how editable rows with selects work with in the grid.  

In the grid colModel they defines the ship column as an edittype:"select" and the

editoptions:{value: "FE:FedEx;IN:InTime;TN:TNT;AR:ARAMEX"}. 

later in the example the dataset is defined as below and loaded to the grid over an iterator and addRowData.

In the ship column, the value preceding the colon is the value (or code/id), i.e. "FE"  and the value after the colon is the label(the visible part),i.e. "FedEx". 

var mydata2 = [
{id:"12345",name:"Desktop Computer",note:"note",stock:"Yes",ship:"FedEx"},
{id:"23456",name:"Laptop",note:"Long text ",stock:"Yes",ship:"InTime"},
{id:"34567",name:"LCD Monitor",note:"note3",stock:"Yes",ship:"TNT"},
{id:"45678",name:"Speakers",note:"note",stock:"No",ship:"ARAMEX"},
{id:"56789",name:"Laser Printer",note:"note2",stock:"Yes",ship:"FedEx"},
{id:"67890",name:"Play Station",note:"note3",stock:"No", ship:"FedEx"},
{id:"76543",name:"Mobile Telephone",note:"note",stock:"Yes",ship:"ARAMEX"},
{id:"87654",name:"Server",note:"note2",stock:"Yes",ship:"TNT"},
{id:"98765",name:"Matrix Printer",note:"note3",stock:"No", ship:"FedEx"}
];

Shouldn't the ship variable above be the code, i.e. "FE"?  But if I change the values for ship in the dataset they aren't translated textually in the cell to the label name corresponding to that value in the select options.  For example if my dataset contains "FE" for ship shouldn't "FedEx" be displayed in the cell?  If I edit the cell and change the value in the select, it displays the selected label in the cell, i.e. "FedEX", but when you do a getRowData, the cell values for the ship column all contain the label name not the actual value from the select, i.e. "FE". 

Am I missing something?  Is there some special code I need to write to handle this?  Has anyone else worked around this?

Hope this makes sense.

Thank you in Advance

carmine

03/02/2010
20:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You should just add another options which will do the job for you

set in colModel - formatter:"select"

http://www.trirand.com/jqgridw.....ype_select

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:
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