Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
More complex XML Schema for Hierarchial Grid
posted

I'm looking to utilize the Hierarchical grid to display some data I have in an XML data file. I'm looking through the examples and I can't find one with a more complex XML. If I reference the Employee example available on the Infragistics page I would like to use an XML schema similar to this:

    var xmlDoc = '<OrgChart Name="All Employees">' +
        '<Employee Name="Gustavo Achong" Age="42" Email="gachong@adventureworks.com">' +
        '<SubEmployee Name="Kim Abercrombie" Age="33" Email="kabercrombie@adventureworks.com" />' +
        '<SubEmployee Name="Lawrence Tapley" Age="52" Email="ltapley@adventureworks.com" />' +
        '</Employee>' +
        '<Employee Name="Catherine Abel" Age="27" Email="cabel@adventureworks.com">' +
        '<SubEmployee Name="Kristen Anderson" Age="30" Email="kanderson@adventureworks.com" />' +
        '<SubEmployee Name="Richard Lee" Age="25" Email="rlee@adventureworks.com" />' +
        '<SubEmployee Name="Victoria Gramley" Age="23" Email="vgramley@adventureworks.com" />' +
        '</Employee>' +
        '<Employee Name="Adrienne Mauro" Age="27" Email="amauro@adventureworks.com">' +
        '<SubEmployee Name="Christopher Chadwick" Age="37" Email="cchadwick@adventureworks.com" />' +
        '</Employee>' +
        '</OrgChart>';

Where we have:

OrgChart

     Employee

          SubEmployee

I just don't know how to express this in the $.ig.DataSchema definition. It looks like it shouldn't be too difficult to get it into the grid after I have it defined in the schema.

Any advice would be great! Thank you.

Parents
  • 2355
    Offline posted

    Hi Marcel,

    The xml data source needs to be recursive like the one we have in the sample (it’s described as a known issue here). What I can advise you to do is to parse your xml to json (examples here) and bind the grid to it.

    Kind regards,
    Petko Zhekov
    Senior Software Engineer

Reply Children
No Data