aboutsummaryrefslogtreecommitdiff
path: root/js/components/combobox.reel
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-02-07 10:58:14 -0800
committerNivesh Rajbhandari2012-02-07 10:58:14 -0800
commit486842239c71e7964f38a09aacda4970f2a82e1a (patch)
tree20a6688d296b1ef09bf32add9dfdef586bfe4207 /js/components/combobox.reel
parent789eaf5a92c903f27462c69a8890fbec695ab14e (diff)
downloadninja-486842239c71e7964f38a09aacda4970f2a82e1a.tar.gz
Updated tools and PI to get/set materials by binding to appModel's materials property. This requires us to add FlatMaterial to the list of materials in the MaterialsLibrary.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/components/combobox.reel')
-rw-r--r--js/components/combobox.reel/combobox.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/js/components/combobox.reel/combobox.js b/js/components/combobox.reel/combobox.js
index deef2a47..8906a649 100644
--- a/js/components/combobox.reel/combobox.js
+++ b/js/components/combobox.reel/combobox.js
@@ -27,6 +27,14 @@ exports.Combobox = Montage.create(Component, {
27 value: null 27 value: null
28 }, 28 },
29 29
30 dataField: {
31 value: null
32 },
33
34 dataFunction: {
35 value: null
36 },
37
30 _items: { 38 _items: {
31 value: [] 39 value: []
32 }, 40 },
@@ -122,7 +130,19 @@ exports.Combobox = Montage.create(Component, {
122 { 130 {
123 var current = items[i]; 131 var current = items[i];
124 optionItem = document.createElement("option"); 132 optionItem = document.createElement("option");
125 optionItem.value = current; 133 if(this.dataFunction)
134 {
135 optionItem.value = this.dataFunction(current);
136 }
137 else if(this.dataField)
138 {
139 optionItem.value = current[this.dataField];
140 }
141 else
142 {
143 optionItem.value = current;
144 }
145
126 if(this.labelFunction) 146 if(this.labelFunction)
127 { 147 {
128 optionItem.innerText = this.labelFunction(current); 148 optionItem.innerText = this.labelFunction(current);