Results 1 to 5 of 5

Thread: How show nested xml data into a tree?

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    7

    Question How show nested xml data into a tree?

    Hi!
    I want to create TreePanel with data model loaded from xml. In docs i find fine examples how to do it with simple structured xml, but not found what doing my case.
    I have next nested xml data structure:
    Code:
    <officeGroup>
        <name>office name 1</name>
        <child>
            <officeGroup>
                <name>office name 1.1</name>
                <employee>
                    <person>
                        <displayName>name 1</displayName>
                    </person>
                </employee>
                <child>
                    <officeGroup>
                        <name>office name 1.1.1</name>
                        <employee>
                            <person>
                                <displayName>name 1</displayName>
                            </person>
                            <person>
                                <displayName>name 2</displayName>
                            </person>
                        </employee>
                    </officeGroup>
                    <officeGroup>
                        <name>office name 1.1.2</name>
                        <employee>
                            <person>
                                <displayName>name 1</displayName>
                            </person>
                            <person>
                                <displayName>name 2</displayName>
                            </person>
                        </employee>
                    </officeGroup>
                </child>
        </child>
    </officeGroup>
    <officeGroup>
        <name>office group 2</name>
        <employee>
            <person>
                <displayName>name 1</displayName>
            </person>
            <person>
                <displayName>name 2</displayName>
            </person>
        </employee>
    </officeGroup>
    One office group may have several children office groups.
    What to do in this case?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    You will need to capture this and turn it into something the store can use.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    7

    Default

    mitchellsimoens,

    I receive this xml from ajax response from server.
    I find Ext.data.reader.Xml useful for it, but i have not found examples how use it when xml have deeply nested tags.

  4. #4
    Sencha User
    Join Date
    Jan 2012
    Posts
    7

    Default

    up

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Posts
    7

    Default

    I solve it by rewriting my xml format as in example and changing server side.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •