| .. | .. |
|---|
| 183 | 183 | $q.all(promises).then(function() { |
|---|
| 184 | 184 | |
|---|
| 185 | 185 | for (var k in refs) { |
|---|
| 186 | | - var pk = that.getPk(that.getMetadata(that.getField(k).resource)) |
|---|
| 186 | + var field = that.getField(k); |
|---|
| 187 | + var pk = that.getPk(that.getMetadata(field.resource)) |
|---|
| 187 | 188 | console.log('PK field for ' + k + ' is ' + pk) |
|---|
| 188 | 189 | var comboData = [] |
|---|
| 189 | 190 | refs[k].forEach(function(row) { |
|---|
| 191 | + console.log('field.resource !== _current.resource: ' + field.resource +' '+ _current.resource) |
|---|
| 190 | 192 | comboData.push({ |
|---|
| 191 | 193 | id: row[pk], |
|---|
| 192 | | - label: row.label || row.name || row.code || row.first_name + ' ' + row.last_name |
|---|
| 194 | + label: row.label || row.name || row.code || row.first_name + ' ' + (row.last_name || '') |
|---|
| 193 | 195 | }); |
|---|
| 194 | 196 | }) |
|---|
| 195 | 197 | refs[k] = comboData; |
|---|