[ALOY-986] Alloy: Allow 'binding' properties to be set on an Alloy view from a controller
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Resolved |
Resolution | Duplicate |
Resolution Date | 2014-04-10T17:27:46.000+0000 |
Affected Version/s | Alloy 1.3.1 |
Fix Version/s | n/a |
Components | n/a |
Labels | Alloy, bindings, controller |
Reporter | Lee Driscoll |
Assignee | Unknown |
Created | 2014-04-08T08:44:08.000+0000 |
Updated | 2018-03-07T22:25:54.000+0000 |
Description
It would be really useful to be able to do something like the following.
At the moment it is impossible because all of the binding properties are 'creation only'.
The benefit of this is that you would be able to create reusable widgets that use Alloy Data Bindings.
var listWindow = Alloy.createController('listWindow', {
dataCollection: 'people',
dataTransform: function(model){
model.fullName = model.firstName + ' ' + model.lastName;
return model;
},
dataFilter: function(collection){
return collection.where({firstName: 'Fred'});
},
rowTitle: "{fullName}"
});
<Alloy>
<Window navBarHidden="false">
<TableView id="table">
<TableViewRow id="tableRow" />
</TableView>
</Window>
</Alloy>
$.table.dataCollection = Alloy.createCollection(args.dataCollection);
$.table.dataTransform = args.dataTransform;
$.table.dataFilter = args.dataFilter;
$.tableRow.title = args.fullName;
Moving this improvement request to engineering for further evaluation and prioritization.
Great suggestion. This looks to be a duplicate of ALOY-931. I'm going to close this ticket, but link 931 to this one to save reference to your implementation suggestion.