简体   繁体   中英

How to change xml binding at runtime in Dashcode (iPhone)

I am working on Dashcode (iphone). I get xml data from a url and need to change or refresh xml binding to a list at runtime. In apple website, there is a way shown to bind xml/Json data only at design time.

Any one knows how to do it ?

Thanks

I found solution for this. Kinda tricky and easy.

//-First get dataSource which is used for binding.
// then change URl property.
var ds = dashcode.getDataSource('dataSource');
ds.url = 'http://192.168.10.14/mysite/sample2.xml';

//-Reload that list which is binded to dataSource. 
var list = document.getElementById('resultList');
list.object.reloadData();

Its done.. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM