Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[how to] iterate in array without a parent #28

Closed
majorebola opened this issue Jul 30, 2016 · 2 comments
Closed

[how to] iterate in array without a parent #28

majorebola opened this issue Jul 30, 2016 · 2 comments

Comments

@majorebola
Copy link

I'm sorry for asking you this question here but I didn't found a better place.

I've been perfectly able to use jquerymy with a pretty complex data like this one

  "parent": {
    "property_one": "value_1",
    "list": [
      {
        "name": "1",
        "desc": "one",
        "sublist": [
          {
            "name": "wow",
            "value": "80"
          },
          {
            "name": "more wow",
            "value": "60"
          }
         ]
      },
      {
        "name": "2",
        "desc": "two",
        "sublist": [
          {
            "name": "wow",
            "value": "80"
          },
          {
            "name": "more wow",
            "value": "60"
          }
         ]
      }
]
}

But I cannot use correctly jquerymy with a "simpler" version

  "parent": [
      {
        "name": "1",
        "desc": "one",
        "sublist": [
          {
            "name": "wow",
            "value": "80"
          },
          {
            "name": "more wow",
            "value": "60"
          }
         ]
      },
      {
        "name": "2",
        "desc": "two",
        "sublist": [
          {
            "name": "wow",
            "value": "80"
          },
          {
            "name": "more wow",
            "value": "60"
          }
         ]
      }
]

I tried a couple of things in the manifest. I read the docs about this but I feel guilty I didnt' get how to do it.

I am probably just blind and not able to see something supersimple, what am I missing?

PS: TY for fixing so quickly the other problem.

@ermouth
Copy link
Owner

ermouth commented Jul 30, 2016

If I understood correctly, you pass an array as a data source. Root data source must be an object, arrays are only allowed as branches for several reasons.

@majorebola
Copy link
Author

Exactly.
Ok. I was thinking I missed smth.

TY very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants