Update specific child to tableView row from a child window?
Update specific child to tableView row from a child window?
I'm trying to update a imageView child to my tableView row from a child window.
I've done this so far
news.js (my first window)
win2.addEventListener("updateBookmarkIcon",function(data){
var rowCdata = tableView.getIndexByName(''+data.rowname+'');
alert(rowCdata);
});
And then in viewnews.js (child window to news.js)
var newdata = {title:title, rowname:''+rowname+''};
win.fireEvent("updateBookmarkIcon",newdata);
This works great I'm getting the rowname as expected.
But I want to hide()/show() a imageView inside my tableView row which is created like this in news.js
var row = Titanium.UI.createTableViewRow({
height:74,
backgroundImage:'images/viewbg1.png',
selectedBackgroundImage:'images/viewbg2.png',
rightImage:'images/arrow.png',
selectionStyle:Titanium.UI.iPhone.TableViewCellSelectionStyle.GRAY,
backgroundLeftCap:10,
backgroundTopCap:10
});
var bookmark_icon = Titanium.UI.createImageView({
backgroundImage:'images/favorit.png',
top:0, right:-22, height:20, width:20 });
bookmark_icon is then added to my "row" like this:
row.add(bookmark_icon);
Is it possible to update a child with this approach? I don't want to rebuild my entire row just to hide/show a child image inside the row.
1 Answer
-
Ted
Are you asking how to show or hide an image? if so, there are show() and hide() methods of the Titanium.UI.ImageView-object. If you need more than this, would you paste the whole script (or a stripped down version of it)?