Community Questions & Answers
Removing child object recursivly
I want to remove all the objects in window before closing it. I tried this method and it seems to working for some extent. If im not mistaken this is not an proper way to do so. ~~~ function removeChildren(parentObj) { var child =...
Removing all child objects from a view
I am trying to remove all child views from a parent view (possibleTagViewArea) using the following code: ~~~ if( possibleTagViewArea.children ){ while( possibleTagViewArea.children.length > 0 ) { Ti.API.info( 'Number of children: ' +...
How do I access tableviewrow children from within the row?
(using Android 2.2, Titanium 3.0) I have a tableview with a for-loop creating about 20 rows or so. I have added two buttons to a view (hidden at first) to each row. Upon clicking an image, a tableview click event uses e.row.children[] to turn on the view...
Trying to hide two buttons inside a table row
I have a click event that will show two buttons I have added to a table row, using e.row.children[]. One button is to remove the current row, the other is to hide the buttons again. Would someone be able to show me the best way of doing this? I can't...
How do I address a table's,row's,child's opacity?
With this code: ~~~ Ti.API.info(JSON.stringify(Generaltable.data[0].rows[i].children[0])); ~~~ I end up with: ~~~ {"rowText":"Weight...
How to get first element of parent object
Hi, Perhaps a stupid question but I am new to Titanium mobile and ran into a "problem". I have a button, which contains an image. When the button is clicked I want the image to change. How could I check in the event listener what image is...
How to show the nav bar in subdirectory?
 This is my project tree. I want to show the navigation bar also in the files of the folder containing the months of the season. How can you do? Thanks!
Loop through parent view and hide its children's children
How would I loop through a parent view, and hide all it's children's children? I have tried this with no success... ~~~ for (var label in mainContainer.children) { if (mainContainer.children.hasOwnProperty(label)) { ...
remove a view from a window recursively
Hello, I have several views added to a main view called view_body. Each view it has a name specified with "name: view_name" attribute when the view is created. I also have an array with all views name I have to remove from view_body. So This is...
How to get children of the current window?
Hi, i'm using Titanium 2.1.0, Android 4.1, Windows 7, I created a window in the app.js and I created an other file where i get the current window `var window = Ti.UI.currentWindow;` when i tried to get the children with `window.getChildren()` it returned...
Child views on Buttons not rendered
I spiced up the ordinary Button with a Label as a child view. This way I have more control over how the label renders (i.e. a shadow for instance) as compared with setting the text directly on the button. This all works fine except that I started noting...
Access to the rows of the table is not correct. Android 2.1
Good day!!! I have: - Application type: mobile - Titanium SDK: 2.1.1GA - Platform & version: Android 2.1, - Device: Android emulator, Motorola Xoom and couple android devices - Host Operating System: Windows 7 - Titanium Studio: Titanium...
Android child node
Hi, I'm trying to do some really simple and yet finding it a real challenge to do! I have a window in which I have a three views. I want to remove the second view using the 'children' function. I am able to do this fine in iOS however on Android i get an...
Swap children in horizontal view
Hi, I have a horizontal view and I need to swap the children so that two elements take each other's original position. Now myView.children is read-only , is there some way in which the following can be done? ~~~ var temp = myView.children[1]...
Remove all children of a view, only if there are children?
I have a view which I need to run a function that populates the view with a series of labels etc. I would like to check before doing this to see if it has already been done (i.e. there are children) and if so, empty the view before adding the items to it....
Give rows in a tableView children when editable?
Hello, I've got a a tableView which I programmatically populate with an array of TableViewRow's. I can give each row a child so that when the row is tapped, it opens up that child. And of course when the tableView entered editable mode, the user can opt...
Access child object by name
I want to select a child by a custom property I have set: ~~~ var someItem = Ti.UI.createView({ height: 90, width: 90, backgroundColor: '#000', name: 'some_name' }); ~~~ I am able to do this by looping through...
children property error on android?
~~~ post_view.addEventListener('click', function(e) { var xxx = e.row.children[0].children[1].text; //alert('e.row.children[0].children[1].text'); //xWindow.open(); }); ~~~ why when i try to get children error on android?
ScrollView.getChildren() return nothing
Hi there, I am working on iOS. SDK v1.8.2 On window's focus event, items are added to the window's scrollView using scrollView.add() under a for loop. If invoke scrollView.getChildren() right after this for loop, it return nothing. but if invoke it a...
Disabling / enabling child controls in TableViewRow
I have a TableView in with rows containing controls. I'd like to be able to disable / enable all the child controls for individual rows. However when I set the enabled property of TextFields (not sure about other controls just yet) it does not seem to be...
Dynamically hide parents children
I would like to hide dynamically created labels when one of the labels parents is clicked. Note the comment in the code below, it may help explain my goal. Basically, there is a main view, which has several subviews and each subview has a label. I want ALL...
Undefined is not an object error
Hi all, I'm getting an undefined object error, which I'm not sure what's causing it, because each line still returns what it is supposed to and the code continues to run without any issues. Is there anything wrong with this code? The menu is a view, with...
Problem accessing tableview row childrens on Android
Hi, using the 1.8.1 sdk, I call : tableview.data[0].rows[0].children[2].text = evt.adressName; this work fine on IOS but the rows (have checked all) have no children (empty array) on Android. Is this a know bug or am I missing something ? Regards
update view content without removing
Hello, I have a simple question ~~~ var view = Ti.UI.createView({ width:'100%', height:50, backgroundColor:'#000' ... .. . }); main_view.add(view); ~~~ Is there a way to update "view" with another declaration avoid removing and adding as...
.children array of a view going to be available moving forward?
It seems pretty well documented that the .children array is gone in 1.8.X on tableViews and tableRowViews. This has caused a large delay in time and cost a good deal of money for my companies project. As a workaround we are no longer using tableViews or...
getChildren in 1.8
The following code ~~~ var win1 = Titanium.UI.createWindow({ backgroundColor : 'red' }); win1.add(Titanium.UI.createLabel({ text:"text", color:"black", backgroundColor:"white" })) Titanium.API.info("output1 : "...
.Children in a TableViewRow?
While accommodating the new V8 runtime I've come across a seemingly simple issue. I have a table view with table rows and each table row has labels in it. How do I get the text value of the labels in the tablerow? My event listener until now has simply...
view children Undefined
Hello, I don't understand why I continually get this error when run my application ~~~ [WARN] Exception in event callback. { expressionBeginOffset = 4773; expressionCaretOffset = 4799; expressionEndOffset = 4804; line = 177; ...
Problem with tableView child windows in Modal Window
Hi All, I have a pretty straightforward app with a 3 tab tabset. At one point I'm opening a modal window in front of that tabset, and trying to display a set of categories as rows in a tableView. Each of those rows hasChild, and they dispatch their click...
Parentless Visible View (or why the view I've removed keeps popping back up)
I have a button which removes all children from a view. This button appears to work as expected and when clicked the all children in the view are removed and disappear from the screen. ~~~ bv.clearBoard = function(){ while (bv.g.children !== null){ ...
android tableviewrow access subelements
is it possible to access tableviewrow subelements in android? i tried but can't get the members of the row-object, except those used when creating a simple row by using title, leftImage, ...
Info TiDOMElement
Hi, I need to get all Children of an TiDOMElement, but i can't find anything in the Docs for get them. I currently using this code: var c = TiDOMElementObj.getElementsByTagName('my_single_tag'); Ti.API.debug("child 0="+c.getChild(0) ); // is...
Why I couldn't find the "children" property in the API docs ?
I was searching how I could use children objects of a tableViewRow. Searching in Q&A i found a solution at this thread: http://developer.appcelerator.com/question/117500/accessing-child-objects-and-functions-inside-an-object The user said to use...
Open window within a modal
I have opened a modal window outside of my main stack and then tried to open another child window inside of the modal, this doesn't do anything. Doesn't even error. I have tried adding my modal window on the root namespace and then referring to it but...
Cant rewrite a table - row - child - property, why?
Hi, I'm developing for iPhone with appcelerator 1.6.1. When I click a row inside a table, a new window opens. Inside that window I want to change the row`s backgroundimage of the first child. So I've saved the row-object as a variable, and passed it to...
Prevent parent's event when fired from child
I've looked over other posts but haven't found anything relevant on what I'm looking for. I have a ScrollableView with some children. If I fire an event in a child (like a touchstart, a scroll, or anything like that) it would get fired in the parent as...
How to get children of scrollable view?
I'm building a photo viewer, similar to the Photos app on iPhone, where you can swipe left and right through photos. To do it, I'm just adding an image view for each photo to a scrollable view, and hiding the paging control. However, when I change the...
Remove childs from view
Hi. I'm trying to remove the childs inside a view but I can't find how to do it. I've seen on other posts that the views have the `children` property, but it always gives me `null` I'm using Android API 2.1 and Titanium 1.4.
Remove child views from a popover
I have tried all tricks to remove child views from a popover but they all dont work the following error is logged instead [WARN] called remove for [object TiUIButton] on [object TiUIiPadPopover], but [object TiUIButton] isn't a child or has already been...
get child at
I was wondering if there's a way to get number of children in a particular view. For instance, I want to get the total number of children in a scroll view then animate fade out and then delete it. Below is the code I'm trying to achieve coming from an AS3...
Showing 1-40 of 40