#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', () => { it('should setup [DROPDOWN] field with REST config', () => {
widget.field = new FormFieldModel(null, { widget.field = new FormFieldModel(null, {
type: FormFieldTypes.DISPLAY_VALUE, type: FormFieldTypes.DISPLAY_VALUE,
restUrl: 'http://test.com',
params: { params: {
field: { field: {
type: FormFieldTypes.DROPDOWN type: FormFieldTypes.DROPDOWN

View File

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