Skip to content

Commit

Permalink
fix(igx-grdi): Remove ngModel from datepicker, #4331
Browse files Browse the repository at this point in the history
  • Loading branch information
sstoyanovIG committed Mar 15, 2019
1 parent d4fd7bc commit 0594b1e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/igniteui-angular/src/lib/grids/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ export class GridBaseAPIService <T extends IgxGridBaseComponent & IGridDataBinda

if (index > -1) {
filteringState.filteringOperands.splice(index, 1);
} else {
} else if (!fieldName) {
filteringState.filteringOperands = [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@
</ng-template>

<ng-template #defaultDateUI>
<igx-date-picker tabindex="0" [(ngModel)]="value" [outlet]="filteringService.grid.outletDirective" [locale]="filteringService.grid.locale" (onClose)="datePickerClose()">
<igx-date-picker
tabindex="0"
[value]="value"
[outlet]="filteringService.grid.outletDirective"
[locale]="filteringService.grid.locale"
(onSelection)="onDateSelected($event)"
(onClose)="datePickerClose()">
<ng-template igxDatePickerTemplate let-openDialog="openDialog" let-displayData="displayData">
<igx-input-group type="box" [displayDensity]="'compact'" [supressInputAutofocus]="true">
<igx-prefix #inputGroupPrefix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,13 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
}
}

/**
* Event handler for date picker's selection.
*/
public onDateSelected(value: Date) {
this.value = value;
}

/**
* Opens the conditions dropdown.
*/
Expand Down

0 comments on commit 0594b1e

Please sign in to comment.