diff --git a/Alloy/commands/compile/parsers/Ti.UI.TableView.js b/Alloy/commands/compile/parsers/Ti.UI.TableView.js
index a279b72..e247035 100644
--- a/Alloy/commands/compile/parsers/Ti.UI.TableView.js
+++ b/Alloy/commands/compile/parsers/Ti.UI.TableView.js
@@ -31,6 +31,7 @@ function parse(node, state, args) {
isDataBound = args[CONST.BIND_COLLECTION] ? true : false,
extras = [],
proxyProperties = {},
+ conditionedProxyProperties = {},
localModel, arrayName, controllerSymbol;
// iterate through all children of the TableView
@@ -77,7 +78,11 @@ function parse(node, state, args) {
code += CU.generateNodeExtended(child, state, {
parent: {},
post: function(node, state, args) {
- proxyProperties[U.proxyPropertyNameFromFullname(fullname)] = state.parent.symbol;
+ if (state.parent.condition) {
+ conditionedProxyProperties[U.proxyPropertyNameFromFullname(fullname)] = {condition: state.parent.condition, symbol: state.parent.symbol};
+ } else {
+ proxyProperties[U.proxyPropertyNameFromFullname(fullname)] = state.parent.symbol;
+ }
}
});
@@ -162,6 +167,12 @@ function parse(node, state, args) {
var tableState = require('./default').parse(node, state);
code += tableState.code;
+ if (conditionedProxyProperties) {
+ _.each(conditionedProxyProperties, function (v, k) {
+ code += 'if (' + v.condition + ') {' + tableState.parent.symbol + "." + k + '= ' + v.symbol + "; }"
+ });
+ }
+
// finally, fill in any model-view binding code, if present
if (isDataBound) {
localModel = localModel || CU.generateUniqueId();
diff --git a/Alloy/commands/compile/parsers/_ProxyProperty.js b/Alloy/commands/compile/parsers/_ProxyProperty.js
index 192b4e0..23f805e 100644
--- a/Alloy/commands/compile/parsers/_ProxyProperty.js
+++ b/Alloy/commands/compile/parsers/_ProxyProperty.js
@@ -50,7 +50,8 @@ function parse(node, state, args) {
return {
parent: {
- symbol: proxy
+ symbol: proxy,
+ condition: state.condition
},
isProxyProperty: true,
propertyName: U.lcfirst(args.fullname.match(/\.([^\.]+)$/)[1] || '')