Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4258330
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:38:05+00:00 2026-05-21T05:38:05+00:00

I have a pretty nested JSON coming from a ldap_search() call. I would like

  • 0

I have a pretty nested JSON coming from a ldap_search() call. I would like to use this information to populate an ExtJS ComboBox, but I am facing some troubles with the reader. Apparently, I am not able to read the information that I need in the ComboBox, that is the mail address of the people, the uid and the cn

I think the whole problem lies in the store. I was trying the following code:

var store= new Ext.data.JsonStore({
        url:'search.php',   
        root: '',
        totalProperty: 'count',
        fields: [
            {name:'cn', type: 'string', mapping:'cn.0'},
            {name:'mail', type: 'string', mapping:'mail.0'},
            {name:'uid', type: 'string', mapping:'uid.0'}
        ]
});

but FireBug told me missing ; before statement return obj.cn.0 in ext-all.js (line 7). I tried with another, easier JSON array and it works, that is why I really think the problem lies in this part of code, especially in the mapping.

an example of JSON returned by search.php is:

{
  "count": 2,
  "0": {
    "mail": {
      "count": 1,
      "0": "Mail address not registered."
    },
    "0": "mail",
    "uid": {
      "count": 1,
      "0": "name0.surname0@domain.com"
    },
    "1": "uid",
    "cn": {
      "count": 1,
      "0": "Surname0 Name0"
    },
    "2": "cn",
    "count": 3,
    "dn": "cn=Surname0 Name0,ou=personal,dc=domain,dc=com"
  },
  "1": {
    "mail": {
      "count": 1,
      "0": "name1.surname1@domain.com"
    },
    "0": "mail",
    "uid": {
      "count": 1,
      "0": "name1.surname1"
    },
    "1": "uid",
    "cn": {
      "count": 1,
      "0": "Surname 1 Name 1"
    },
    "2": "cn",
    "count": 3,
    "dn": "cn=Surname1 Name1,ou=personal,dc=domain,dc=com"
  }
}

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T05:38:05+00:00Added an answer on May 21, 2026 at 5:38 am

    Yep, that JSON structure is not going to work straight away with standard ExtJS JSONReader. Take a look at this example taken from the ExtJS API documentation on how the JSON should look like.

    {
        results: 2000, // Reader's configured totalProperty
        rows: [        // Reader's configured root
            // record data objects:
            { id: 1, firstname: 'Bill', occupation: 'Gardener' },
            { id: 2, firstname: 'Ben' , occupation: 'Horticulturalist' },
            ...
        ]
    }
    

    Also, the root config option is required, you cannot leave it empty. In the above example your root would be “rows”.

    You are probably going to need to parse that JSON of yours into a simpler format at first, before feeding it to the JSONReader.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have pretty URLs for my tagging system along with all
I have a pretty common case for nested routes, I feel like, that looks
I'm wondering if this is possible. I have html like so: <p> <font face=Georgia>
I have pretty much finished my first working Symbian application, but in my hastened
I have pretty big background of .net, and I've decided that i want to
I have a pretty standard table set-up in a current application using the .NET
I have a pretty complicated Linq query that I can't seem to get into
I have a pretty basic windows form app in .Net. All the code is
I have a pretty standard django app, and am wondering how to set the
I have a pretty generic Article model, with m2m relation to Tag model. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.