Documentation for layout, heights + tableview events.
First off, this appears to be a great product, I've been hacking away with it for a few days now, but a few things have irked me, mainly around the lack of documentation.. I'd love to see an O'Reilly book on it !!
I can't find any documentation about the layout: attribute, specifically, I think I understand how layout:'vertical' works, ie, it's like a non-floating div, as opposed to an absolutely positioned div.. but I'd rather not make guesses when trying to build a real-world app. Looking for the attribute under the View documentation, it's not even listed. So am I using a hack, or is it just undocumented ?
I can't find any documentation how height: auto works, sometimes it does what I think, and expands to fit the remaining space, othertimes not.
There are Events listed for TableView that just don't fire, any of them that I can see.
Sure, I've seen alot of comments about "look at the examples", but that only shows me what happens when I use the same code, it doesn't tell me why certain things happen, and doesn't tell me what alternative things I can do, or give pointers when it goes wrong.
Also, Googling stuff to find solutions I end up finding old solutions using the old version of Titanium, specifically stuff at http://www.codestrong.com
It'd be great to have a big banner saying "1.0 users ignore this it's out of date".. because there have been so many changes to the API and because there's so little documentation people are going to be trying out old unworking code and wasting their time.
2 Answers
-
+1 understanding how all of this works is really a nightmare and a great waste of time. And if you think you have understood how this works with Android … try your application with IPhone and be sure the way the application works will be totally different !
-
I'm very disapointed with the way how window.open won't fit screen space. I vote for this question and really need answer.
Edit: I have found my way !!! use this:
var nextwin = Ti.UI.createWindow({ modal: true })
then newtwin will fit the screen. You can use fullscreen if you want but you will lose the top bar :)
For tableview event, kitchenSink have a lot of example. The mainly way to have event and datas are this:
var rows = [ {title: "the title one", myattribute: 'views/myview1.js'}, {title: "the title two", myattribute: 'views/myview2.js'}, {title: "the title three", myattribute: 'views/myview3.js'}, ]; var mainTableView = Titanium.UI.createTableView({ data: rows, top: 10, height: 'auto', separatorStyle: Ti.UI.iPhone.TableViewSeparatorStyle.NONE }); mainTableView.addEventListener('click', function(e){ if (e.rowData.target) { var nextwin = Titanium.UI.createWindow({ url:e.rowData.myattribute, title:e.rowData.title, modal: true, backgroundColor: '#000', }); nextwin.open({animated:true}); } });
rowData taken from event have every information you need. My documentation is KitchenSink. Website is very in late…