diff --git a/demos/app/combo/sample.component.html b/demos/app/combo/sample.component.html index c2c12fe3022..2010a0b1b50 100644 --- a/demos/app/combo/sample.component.html +++ b/demos/app/combo/sample.component.html @@ -2,21 +2,23 @@

Change data to:

- - - + + + - +
- {{display[key]}} + +

State: {{display[key]}}

+

Region: {{display.county}}

- - -
This is a header
+ + +
\ No newline at end of file diff --git a/demos/app/combo/sample.component.ts b/demos/app/combo/sample.component.ts index 7188c6cf7df..c049e2d7793 100644 --- a/demos/app/combo/sample.component.ts +++ b/demos/app/combo/sample.component.ts @@ -125,7 +125,6 @@ export class ComboSampleComponent implements OnInit { } this.items.push(item); this.initData = this.items; - this.currentDataType = "initial"; } } diff --git a/src/combo/combo.component.html b/src/combo/combo.component.html index cf8e43455a4..5fb6da3da15 100644 --- a/src/combo/combo.component.html +++ b/src/combo/combo.component.html @@ -1,4 +1,4 @@ - + {{display[key]}} @@ -23,7 +23,7 @@ - + diff --git a/src/combo/combo.component.spec.ts b/src/combo/combo.component.spec.ts index 87878367397..253a68324be 100644 --- a/src/combo/combo.component.spec.ts +++ b/src/combo/combo.component.spec.ts @@ -10,6 +10,26 @@ describe("Combo", () => { })); it("Initialize combo", () => { + // TO DO + }); + + it("Initialize combo", () => { + // TO DO + }); + + it("Initialize combo", () => { + // TO DO + }); + it("Initialize combo", () => { + // TO DO + }); + + it("Initialize combo", () => { + // TO DO + }); + + it("Initialize combo", () => { + // TO DO }); }); diff --git a/src/combo/combo.component.ts b/src/combo/combo.component.ts index 9e089ec9fd0..dbc9f3822d0 100644 --- a/src/combo/combo.component.ts +++ b/src/combo/combo.component.ts @@ -127,15 +127,15 @@ export class IgxComboComponent implements OnInit, OnDestroy { } - protected prepare_filtering_expression(state, searchVal, condition, ignoreCase) { - const newExpression = { searchVal, condition, ignoreCase }; - state.push(newExpression); + protected prepare_filtering_expression(searchVal, condition, ignoreCase, fieldName?) { + if (fieldName !== undefined) { + return [{ fieldName, searchVal, condition, ignoreCase }]; + } + return [{ searchVal, condition, ignoreCase }]; } - public filter(term, condition, ignoreCase) { - const filteringState = this.filteringExpressions; - this.prepare_filtering_expression(filteringState, term, condition, ignoreCase); - this.filteringExpressions = filteringState; + public filter(term, condition, ignoreCase, primaryKey?) { + this.filteringExpressions = this.prepare_filtering_expression(term, condition, ignoreCase, primaryKey); } public get displayedData() { @@ -146,7 +146,8 @@ export class IgxComboComponent implements OnInit, OnDestroy { } public hanldeKeyDown(evt) { if (this.filterable) { - this.filter(evt.target.value, STRING_FILTERS.contains, true); + this.filter(evt.target.value, STRING_FILTERS.contains, + true, this.getDataType() === DataTypes.PRIMITIVE ? undefined : this.primaryKey); } }