Class IgxSimpleComboComponent

ユーザーが定義済みのリストから単一のオプションを選択できるフィルタリング機能を提供するドロップダウンリストを表します。

Igx Module

IgxSimpleComboModule

Igx Theme

igx-combo-theme

Igx Keywords

combobox, single combo selection

Igx Group

グリッド & リスト

備考

項目をフィルターする機能、および提供されたデータで単一選択を実行する機能を提供します。 また、キーボード ナビゲーションおよびカスタム スタイル設定機能を公開します。

<igx-simple-combo [itemsMaxHeight]="250" [data]="locationData"
[displayKey]="'field'" [valueKey]="'field'"
placeholder="Location" searchPlaceholder="Search...">
</igx-simple-combo>

階層

Hierarchy

  • IgxComboBaseDirective
    • IgxSimpleComboComponent

実装

  • ControlValueAccessor
  • AfterViewInit
  • DoCheck

コンストラクター

プロパティ

addItemTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ ドロップダウンの ADD BUTTON の描画に使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.addItemTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboAddItem>
<button type="button" igxButton="raised" class="combo__add-button">
Click to add item
</button>
</ng-template>
</igx-combo>
addition: EventEmitter<IComboItemAdditionEvent> = ...

項目がデータ コレクションに追加されているときに発生されます。

<igx-combo (addition)='handleAdditionEvent($event)'></igx-combo>
allowCustomValues: boolean = false

カスタム値をコレクションに追加できるかどうかを制御します。

// get
let comboAllowsCustomValues = this.combo.allowCustomValues;
<!--set-->
<igx-combo [allowCustomValues]='true'></igx-combo>
ariaLabelledBy: string

aria-labelledby 属性値を設定します。

<igx-combo [ariaLabelledBy]="'label1'">
clearIconTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ CLEAR ボタンを描画するために使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.clearIconTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboClearIcon>
<igx-icon>clear</igx-icon>
</ng-template>
</igx-combo>
closed: EventEmitter<IBaseEventArgs> = ...

ドロップダウンが閉じた後に発生されます。

<igx-combo (closed)='handleClosed($event)'></igx-combo>
closing: EventEmitter<IBaseCancelableBrowserEventArgs> = ...

ドロップダウンが閉じられる前に発生されます。

<igx-combo (closing)='handleClosing($event)'></igx-combo>
dataPreLoad: EventEmitter<IForOfState> = ...

新しいデータの塊が仮想化から読み込まれたときに発生されます。

<igx-combo (dataPreLoad)='handleDataPreloadEvent($event)'></igx-combo>
densityChanged: EventEmitter<IDensityChangedEventArgs> = ...
disabled: boolean = false

コンボを無効にします。デフォルトは false です。

<igx-combo [disabled]="'true'">
emptyTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ ドロップダウンの ADD BUTTON の描画に使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.emptyTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboEmpty>
<div class="combo--empty">
There are no items to display
</div>
</ng-template>
</igx-combo>
filterFunction: ((collection, searchValue, filteringOptions) => any[])

コンボのカスタム フィルタリング機能を取得または設定します。

 <igx-comb #combo [data]="localData" [filterFunction]="filterFunction"></igx-combo>

Type declaration

    • (collection, searchValue, filteringOptions): any[]
    • パラメーター

      返却 any[]

footerTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ項目リストのための FOOTER の描画に使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.footerTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboFooter>
<div class="combo__footer">
This is a custom footer
</div>
</ng-template>
</igx-combo>
headerItemTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ リスト内のグループのため HEADER ITEMS の描画に使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.headerItemTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboHeaderItem let-item let-key="groupKey">
<div class="custom-item--group">Group header for {{ item[key] }}</div>
</ng-template>
</igx-combo>
headerTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ項目リストのための HEADER の描画に使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.headerTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboHeader>
<div class="combo__header">
This is a custom header
</div>
</ng-template>
</igx-combo>
id: string = ...

コンボの id を取得または設定します。

// get
let id = this.combo.id;
<!--set-->
<igx-combo [id]='combo1'></igx-combo>
itemTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ リストの ITEMS の描画に使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.itemTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboItem let-item let-key="valueKey">
<div class="custom-item">
<div class="custom-item__name">{{ item[key] }}</div>
<div class="custom-item__cost">{{ item.cost }}</div>
</div>
</ng-template>
</igx-combo>
itemsWidth: string

ドロップダウン リストの幅を構成します。

// get
let myComboItemsWidth = this.combo.itemsWidth;
<!--set-->
<igx-combo [itemsWidth] = '"180px"'></igx-combo>
opened: EventEmitter<IBaseEventArgs> = ...

ドロップダウンが開かれた後に発生されます。

<igx-combo (opened)='handleOpened($event)'></igx-combo>
opening: EventEmitter<IBaseCancelableBrowserEventArgs> = ...

ドロップダウンが開かれる前に発生されます。

<igx-combo opening='handleOpening($event)'></igx-combo>
overlaySettings: OverlaySettings = null

コンボの項目リストの表示方法を制御するカスタム オーバーレイ設定を設定します。 設定:

<igx-combo [overlaySettings]="customOverlaySettings"></igx-combo>
 const customSettings = { positionStrategy: { settings: { target: myTarget } } };
combo.overlaySettings = customSettings;

コンボで使用されるカスタム オーバーレイ設定を取得します。

 const comboOverlaySettings: OverlaySettings = myCombo.overlaySettings;
placeholder: string

コンボの値フィールドのプレースホルダー値を定義します。

// get
let myComboPlaceholder = this.combo.placeholder;
<!--set-->
<igx-combo [placeholder]='newPlaceHolder'></igx-combo>
searchInputUpdate: EventEmitter<IComboSearchInputEventArgs> = ...

検索入力の値が変更 (入力、貼り付け、クリアなど) するときに発生されます。

<igx-combo (searchInputUpdate)='handleSearchInputEvent($event)'></igx-combo>
selectionChanging: EventEmitter<ISimpleComboSelectionChangingEventArgs> = ...

選択を完了する前に項目選択が変更されるときに発生されます。

<igx-simple-combo (selectionChanging)='handleSelection()'></igx-simple-combo>
showSearchCaseIcon: boolean = false

caseSensitive アイコンを検索入力に表示するかどうかを定義します。

// get
let myComboShowSearchCaseIcon = this.combo.showSearchCaseIcon;
<!--set-->
<igx-combo [showSearchCaseIcon]='true'></igx-combo>
toggleIconTemplate: TemplateRef<any> = null

カスタム テンプレートがある場合は、コンボ TOGGLE (開く/閉じる) ボタンを描画するために使用されます。

// Set in typescript
const myCustomTemplate: TemplateRef<any> = myComponent.customTemplate;
myComponent.combo.toggleIconTemplate = myCustomTemplate;
<!-- Set in markup -->
<igx-combo #combo>
...
<ng-template igxComboToggleIcon let-collapsed>
<igx-icon>{{ collapsed ? 'remove_circle' : 'remove_circle_outline'}}</igx-icon>
</ng-template>
</igx-combo>
valueKey: string = null

値を決定するためにデータ ソースのどの列を使用するかを決定します。

// get
let myComboValueKey = this.combo.valueKey;
<!--set-->
<igx-combo [valueKey]='myKey'></igx-combo>
width: string

要素のスタイルの幅を設定します。

// get
let myComboWidth = this.combo.width;
<!--set-->
<igx-combo [width]='250px'></igx-combo>

アクセサー

  • get displayKey(): string
  • 表示値を決定するためにデータ ソースのどの列を使用するかを決定します。

    // get
    let myComboDisplayKey = this.combo.displayKey;

    // set
    this.combo.displayKey = 'val';
    <!--set-->
    <igx-combo [displayKey]='myDisplayKey'></igx-combo>

    返却 string

  • set displayKey(val): void
  • パラメーター

    • val: string

    返却 void

  • get groupKey(): string
  • 項目リストで項目をグループ化する項目プロパティです。データが Object[] 型ではない場合に利用できません。

    // get
    let currentGroupKey = this.combo.groupKey;

    返却 string

  • set groupKey(val): void
  • 項目リストで項目をグループ化する項目プロパティです。データが Object[] 型ではない場合に利用できません。

    <!--set-->
    <igx-combo [groupKey]='newGroupKey'></igx-combo>

    パラメーター

    • val: string

    返却 void

  • get totalItemCount(): number
  • リモート サービスを使用する場合、仮想データ項目の合計数を取得します。

    // get
    let count = this.combo.totalItemCount;

    返却 number

  • set totalItemCount(count): void
  • リモート サービスを使用する場合、仮想データ項目の合計数を設定します。

    // set
    this.combo.totalItemCount(remoteService.count);

    パラメーター

    • count: number

    返却 void

アクセサー

  • 表示密度の値に基づいて --component-size CSS 変数を設定します。

    返却 "var(--ig-size, var(--ig-size-small))" | "var(--ig-size, var(--ig-size-medium))" | "var(--ig-size, var(--ig-size-large))"