admin管理员组文章数量:1305613
my code is
var tableData=[];
var dict ={};
dict["title"] ='My Title';
tableData[0] =dict;
var table = Ti.UI.createTableView({
data:tableData,
});
self.add(table);
This data is displayed properly.
Then in some function i am updating the array.
var dict ={};
dict["title"] ='My New Title';
dict["hasChild"]=true;
tableData[0] =dict;
And setting table data using setData:
table.setData(tableData);
But there is no changes in tableView, i searched similar questions but din't get any help.
my code is
var tableData=[];
var dict ={};
dict["title"] ='My Title';
tableData[0] =dict;
var table = Ti.UI.createTableView({
data:tableData,
});
self.add(table);
This data is displayed properly.
Then in some function i am updating the array.
var dict ={};
dict["title"] ='My New Title';
dict["hasChild"]=true;
tableData[0] =dict;
And setting table data using setData:
table.setData(tableData);
But there is no changes in tableView, i searched similar questions but din't get any help.
Share Improve this question edited Jul 11, 2018 at 7:53 Cœur 38.8k26 gold badges205 silver badges277 bronze badges asked Mar 20, 2012 at 16:50 PreethamPreetham 1251 silver badge11 bronze badges 1- show some more code .... – Maulik Commented Mar 21, 2012 at 8:34
3 Answers
Reset to default 3This would work... Before you set the updated data, make the tableView empty with a blank array and then update again with new data.
table.setData([]);
table.setData(tableData);
Try to remove first all the objects from the array and then update your array object and after then reload the table with table.setData(tableData);
You can also change the Table Data with table.data = tableData;
In some Cases you need to re-set the Data with table.setData( table.data );
本文标签: javascriptHow to reload tableView in titaniumStack Overflow
版权声明:本文标题:javascript - How to reload tableView in titanium? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741804619a2398425.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论