1

I have the following DOM object:

> this
<input type=​"checkbox" class=​"datafieldchk" data-collection=​"collection_name" 
data-column-id=​"rds_issuer" data-company-default=​"true" 
data-display-name=​"Issuer ID" data-physical-name=​"ISSR_ID">​

But, when I try to grab all the data into an array using jQuery (1.10.2), the collection value is missing.

> $(this).data()
Object {columnId: "rds_issuer", companyDefault: true, displayName: "Issuer ID", 
physicalName: "ISSR_ID"}

Accessing the property directly works fine:

> $(this).data("collection")
rds_issuer_inc

All of the properties are set directly on the object before page load, there's no jQuery manipulation or anything like that going on, it just doesn't like to get all of my properties.

2
  • 3
    More code is needed, because accessing the element works just fine: jsfiddle.net/7qptp Commented Mar 1, 2014 at 20:42
  • 1
    Which browser (console) are you using? I did a quick test in Firefox (Aurora) with both jQ1.10.2 and jQ1.11.0 - and the console shows all data values correctly. Commented Mar 1, 2014 at 21:39

1 Answer 1

2

i tried changing lorenzo's jsfiddle with jquery 1.10.2 both uncompressed and minified and i've had no issues either. since accessing the property directly works, i would try testing this the same way the fiddle does - by displaying it on your ui instead of the console.

Sign up to request clarification or add additional context in comments.

1 Comment

You're absolutely correct. It does work as intended. The issue has disappeared, and I may never know what the actual cause was.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.