[ALOY-904] Requesting widgets/requires to receive reference to their parent
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Widgets |
Labels | proxy, require, widgets |
Reporter | Fokke Zandbergen |
Assignee | Tim Poulsen |
Created | 2013-12-18T11:34:35.000+0000 |
Updated | 2014-08-28T21:15:00.000+0000 |
Description
Following the discussion in #ALOY-903 I'd like to request that widgets and required controllers receive their parent element as an argument.Why I need this... since Alloy 1.3.0
As I've understood from [~tlukasavage] this is similar but not exactly the same as the internally used__parentSymbol
. I think this is in particular true for proxy elements since Alloy 1.3.0. Earlier, these received the __parentSymbol
property and were bound to their parent from within the widget. Since Alloy 1.3.0 however, the binding takes place in the controller that hosts the table and the widget no longer receives the property:
$.__views.is = Alloy.createWidget("nl.fokkezb.infiniteScroll", "widget", {
id: "is"
});
onEnd ? $.__views.is.on("end", onEnd) : __defers["$.__views.is!end!onEnd"] = true;
$.__views.ptr = Alloy.createWidget("nl.fokkezb.pullToRefresh", "widget", {
id: "ptr"
});
onEnd ? $.__views.ptr.on("release", onEnd) : __defers["$.__views.ptr!release!onEnd"] = true;
$.__views.table = Ti.UI.createTableView({
footerView: $.__views.is.getProxyPropertyEx("footerView", {
recurse: true
}),
headerPullView: $.__views.ptr.getProxyPropertyEx("headerPullView", {
recurse: true
}),
headerView: $.__views.ptr.getProxyPropertyEx("headerView", {
recurse: true
}),
id: "table"
});
This is fine and I guess better then before, but I'm sure it's possible to still pass the parent back to the widget?
Attachments
File | Date | Size |
---|---|---|
StarWidget.zip | 2014-03-26T19:31:04.000+0000 | 5800495 |