mDataProp issue referencing variable within array

mDataProp issue referencing variable within array

DaReaper5DaReaper5 Posts: 4Questions: 0Answers: 0
edited November 2012 in General
Hi, I am having two issues with using mDataProp to reference a variable inside an array:

1) Here is a live example that kind of works but field 2 displays wrong:
http://live.datatables.net/egegof/edit#javascript,html

2) Here is a live example that does not work because field 2 is null:
http://live.datatables.net/egegof/2/edit


Everything works if the field is not within an array:
http://live.datatables.net/egegof/3/edit

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    > field2[0].inner.name

    Use:

    [code]
    field2.0.inner.name
    [/code]

    http://live.datatables.net/egegof/4/edit

    Array syntax to pick out a single element from an array is not supported, but object donated notation does what is needed :-).

    Allan
  • DaReaper5DaReaper5 Posts: 4Questions: 0Answers: 0
    Thank you allan, that worked!
This discussion has been closed.