Load specific data from xml

New Jersey Cities Trenton Newark Willsborough

Hi, given the example above, How do I load the cities with a given id # into a data container.
My app allows you to choose a state, Once you choose a state I want the cities to show up in a different layout cell. How would i go about in doing so.

I already have ;(if its even right)
datacities.load(“States.xml”,getCities(ID));
function getCities(ID){

          What goes in here?
            }

Thanks!!

Assuming that you have

//a and b - ids of cells, where dataviews need to be placed var datastates = layout.cells("a").attachDataView({ ... }); var datacities = layout.cells("b").attachDataView({ ... });

You can use

datastates.attachEvent("onAfterSelect", function(id){ datacities.clearAll(); datacities.load("cities.php?for="+id); })

Hi, thank you for your quick reply but i wasn’t able to integrate that into my code. I have attached an Image as well as the code for a better understanding… I hope you can help me thanks!!

direct link is img6.glowfoto.com/images/2010/08 … 23195L.jpg
based on geo.zip (253 KB)

Above code fixed, a bit - there was a typo in first part.
As for XML format

docs.dhtmlx.com/doku.php?id=dhtm … ng#loading

Be sure to configure xml settings as

dhtmlx.dataDriver.xml.records = “/*/state”; //or other xpath, as it necessary in your case