So, in Titanium, you are unable to extend the native classes. You’re also unable to add methods to native objects or re-assign methods (so, if you wanted to, say, modify an object so that the “hide” function triggers an event, tough sh*t). There is, however, a decent way of getting around this inadequacy (read: violant violation of the ECMA standards, but who are we to judge).
var Klass = function(){ this.toView = function(){ return Klass.prototype } } Klass.prototype = Ti.UI.createView({ /*... the rest of the parameters here (as usual) ... */ }); var view = new Klass();
Then, if you want to add the object to a window, you need to remember to call win.add(view.toView()), but it means you can now carry around the data object with *all* of its data.