Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top