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
Dot Notation for column name.. how to get value issue?
26/03/2010
13:06
Avatar
mikesmith
Member
Members
Forum Posts: 47
Member Since:
26/01/2010
sp_UserOfflineSmall Offline

I need help on this issue as I am unable to access the value of a column whose name has a dot notation.

Has anyone got any tips on this?

I have a column whose name is document.imageUploadedR

<sj:gridColumn name="document.imageUploadedR" index="documentImageUploadedRHeader".....

       

which is populated correctly with data as the grid loads.. here is part of the json string...  

"document":{"batchNo":null,"comment":"","imageUploadedR":"Y","projectId":1,"userId":1}

When I try to access the rowData and try and access the value in that column, I get undefined.

var ret = jQuery("#documentgrid").jqGrid('getRowData',1);

alert(ret.document.imageUploadedR);

When I console.log my ret value I can see the data as document.imageUploadedR           "Y"

It seems something different must be done with columns that have a dot notation. Columns without a dot notation seem to work fine!

Thanks for any help on this as I am very stuck!

26/03/2010
15:39
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Create a object manually like this:

var ret = {"prop1″ : "value1″, "document.imageUploadedR": "value2"}

then try to alert it this vay

alert(ret.document.imageUploadedR);

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.

29/03/2010
18:33
Avatar
mikesmith
Member
Members
Forum Posts: 47
Member Since:
26/01/2010
sp_UserOfflineSmall Offline

Hi

Is there a method to convert a row in the grid into the object that you mentioned in your post?.. It would make things easier as then i can then access the data I want with the dot notation as the name for a column.

Otherwise its impossible to access values from a column which has a dot notation as its name.

thanks Tony

31/03/2010
19:58
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I suggest you to try to acces the value this way

alert( ret["document.imageUploadedR"] ); Wink

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