开发者

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

开发者 https://www.devze.com 2023-04-12 00:09 出处:网络
I am working 开发者_JAVA技巧on Dashcode (iphone). I get xml data from a url and need to change or refresh xml binding to a list at runtime.

I am working 开发者_JAVA技巧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.. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消