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
setting the property "value" for elements
19/02/2009
13:46
Avatar
cartman
Member
Members
Forum Posts: 18
Member Since:
14/02/2009
sp_UserOfflineSmall Offline

Hi Tony,

Currently I haven't figured out a way to obtain the value from a cell easily when using advanced edittypes such as a select.

I would like to suggest if you could add the property "value" to all the <td>cells then we could easily obtain the set value that was selected using standard jQuery function val().

Right now the <td> entry looks like this for a cell:

<td title='One'>One</td>

If you added the value property then for a select type it could show something like this:

<td title='One' value='1'>One</td>

Please let me know what you think (unless you know of an easier way to obtain these values?).

Thanks!

20/02/2009
02:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Also I see you  have difficulties to do that, but my question is?

Haw we can obtain this value ?

Also here is a common approach. Get the values from editoption of the select - convert this string to array so that you have key->value. You should see this array in the jQuery scope, or make it global. After that is easy to do what you want. Get key from value is easy job for you.

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.

20/02/2009
11:00
Avatar
cartman
Member
Members
Forum Posts: 18
Member Since:
14/02/2009
sp_UserOfflineSmall Offline

Hi Tony,

Thanks for the suggestion to use editoptions key->value. I can then reverse lookup the key if I want by referencing that array.

I'll try that and see how I can make it work.

Thanks!

22/02/2009
07:09
Avatar
james_
Member
Members
Forum Posts: 27
Member Since:
16/02/2009
sp_UserOfflineSmall Offline

Isn't the point of having a key that it's the one thing we can expect to be unique? The value/name isn't necessarily unique, and in many cases it's user input. I agree that a user shouldn't -- and perhaps should be allowed to -- create two items with the same name, but I think it'll happen and there's a reason select-elements are built like they are.

It's a solution to do lookups the other way, but not sure if it's very bullet proof 🙂

I also posted in "Help"-forum that when using GridToForm the key is not sent there either. This is something I use to store data on the server, and I want to store the key of course since it's used for relations. I'm currently working around it by doing a lookup for the ID on the server side code before updating the DB.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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