jQuery UI Widgets Forums Navigation Tree Getting "Item" as child element when tree is generated from XML

This topic contains 3 replies, has 2 voices, and was last updated by  Dimitar 8 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • Anmol Jain
    Participant

    Hi Team,

    we are building JQxTree using XML below, we are getting “Item” as third level child for few records.
    We don’t need the dummy child “item” if child is not available.
    Please suggest a solution so that “Item” can be removed.

    BuildingTree
    > Building Name
    > “Item”

    Our XML looks like :

    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[1]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[11182]]></AddressId>
    <FullAddress><![CDATA[13, Canada Real De Merinas A La Av. De La Hispanidad, Madrid, 28052, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[2]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[117412]]></AddressId>
    <FullAddress><![CDATA[13-15, Canada Real De Las Merinas, Madrid, 28042, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[3]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[11185]]></AddressId>
    <FullAddress><![CDATA[13, Canada Real De Las Merinas, Madrid, 28042, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[4]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[214564]]></AddressId>
    <FullAddress><![CDATA[13-15, Calle Canada Real De Las Merinas, Madrid(Madrid), 28052, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[5]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[11183]]></AddressId>
    <FullAddress><![CDATA[13, Canada Real De Las Marinas, Madrid, 28042, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[6]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[257779]]></AddressId>
    <FullAddress><![CDATA[13, Acceso De La Canada Real De Las Merinas A La Avenida De La Hispanidad, Madrid, 28052, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    <SiteId><![CDATA[MAD01153/003]]></SiteId>
    <SiteName><![CDATA[ES_28042_CANADA REAL DE LAS MERINAS_13_5_LOGWIN]]></SiteName>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[7]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[257779]]></AddressId>
    <FullAddress><![CDATA[13, Acceso De La Canada Real De Las Merinas A La Avenida De La Hispanidad, Madrid, 28052, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    <SiteId><![CDATA[MAD01153/001]]></SiteId>
    <SiteName><![CDATA[ES_28042_CANADA REAL DE LAS MERINAS_13_5_SPICE-PC]]></SiteName>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[8]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[257779]]></AddressId>
    <FullAddress><![CDATA[13, Acceso De La Canada Real De Las Merinas A La Avenida De La Hispanidad, Madrid, 28052, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    <SiteId><![CDATA[MAD04877/001]]></SiteId>
    <SiteName><![CDATA[ES_28042_CANADA REAL DE LAS MARINAS_13_3]]></SiteName>
    </content>
    </BuildingTree>
    <BuildingTree>
    <content type="application/xml">
    <UId><![CDATA[9]]></UId>
    <BuildingID><![CDATA[ESMAD-0000003023]]></BuildingID>
    <AddressId><![CDATA[257779]]></AddressId>
    <FullAddress><![CDATA[13, Acceso De La Canada Real De Las Merinas A La Avenida De La Hispanidad, Madrid, 28052, Spain]]></FullAddress>
    <BuildingType><![CDATA[On Net]]></BuildingType>
    <SiteId><![CDATA[MAD01153/002]]></SiteId>
    <SiteName><![CDATA[ES_28042_CA√ĎADA REAL DE LAS MERINAS_13-15_2_201]]></SiteName>
    </content>
    </BuildingTree>
    </root>

    Thanks,
    Anmol Jain


    Dimitar
    Participant

    Hello Anmol Jain,

    Please clarify. There is no mention of “Building Name” or “Item” in your XML. It would be best if you can illustrate your question/issue using our XML Tree demo.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    Anmol Jain
    Participant

    Dear Dimitar,

    Based on the above xml we are expecting a tree as below:

    • ESMAD-0000003023
      • 13, Canada Real De Merinas A La Av. De La Hispanidad, Madrid, 28052, Spain
      • 13-15, Canada Real De Las Merinas, Madrid, 28042, Spain
      • 13, Canada Real De Las Merinas, Madrid, 28042, Spain
      • 13-15, Calle Canada Real De Las Merinas, Madrid(Madrid), 28052, Spain
      • 13, Canada Real De Las Marinas, Madrid, 28042, Spain
      • 13, Acceso De La Canada Real De Las Merinas A La Avenida De La Hispanidad, Madrid, 28052, Spain
        • MAD01153/003
        • MAD01153/001
        • MAD04877/001
        • MAD01153/001

    How ever we are geting the below:

    • ESMAD-0000003023
      • 13, Canada Real De Merinas A La Av. De La Hispanidad, Madrid, 28052, Spain
        • Item1
      • 13-15, Canada Real De Las Merinas, Madrid, 28042, Spain
        • Item1
        • Item2
      • 13, Canada Real De Las Merinas, Madrid, 28042, Spain
      • 13-15, Calle Canada Real De Las Merinas, Madrid(Madrid), 28052, Spain
      • 13, Canada Real De Las Marinas, Madrid, 28042, Spain
      • 13, Acceso De La Canada Real De Las Merinas A La Avenida De La Hispanidad, Madrid, 28052, Spain
        • MAD01153/003
        • MAD01153/001
        • MAD04877/001
        • MAD01153/001

    I do not need the elements Item1, Item2 etc.
    Please let me know how to fix this.

    Regards,
    Anmol Jain

    • This reply was modified 8 years, 6 months ago by  Anmol Jain.
    • This reply was modified 8 years, 6 months ago by  Anmol Jain.
    • This reply was modified 8 years, 6 months ago by  Anmol Jain.

    Dimitar
    Participant

    Hi Anmol Jain,

    Could you, please, provide us with a JSFiddle example with your tree loaded with said XML? We would require to look at your JavaScript code to see how we may assist you. You may have to remove the unnecessary items after initialization (on the initialized event) with the method removeItem.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.