#1327 do not call server when dropdown are not rest (#1328)

This commit is contained in:
Mario Romano
2016-12-19 16:39:05 +00:00
committed by Eugenio Romano
parent 72ae760b85
commit ea7df8ac22
2 changed files with 7 additions and 1 deletions

View File

@@ -205,6 +205,7 @@ describe('DisplayValueWidget', () => {
it('should setup [DROPDOWN] field with REST config', () => {
widget.field = new FormFieldModel(null, {
type: FormFieldTypes.DISPLAY_VALUE,
restUrl: 'http://test.com',
params: {
field: {
type: FormFieldTypes.DROPDOWN

View File

@@ -96,7 +96,11 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
this.loadRestFieldValue();
break;
case FormFieldTypes.DROPDOWN:
this.loadRestFieldValue();
if (this.field.restUrl) {
this.loadRestFieldValue();
} else {
this.value = this.field.value;
}
break;
case FormFieldTypes.RADIO_BUTTONS:
if (this.field.restUrl) {
@@ -207,6 +211,7 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
}
getCellValue(row: DynamicTableRow, column: DynamicTableColumn): any {
let result = row.value[column.id];
if (column.type === 'Dropdown') {