文章分類/

Infragistics|Ignite UI for Angular|IgxGrid:編輯開始時使用 IgxFocus 指令聚焦單元格編輯模板

尚無瀏覽量
2023-10-02 更新

infragistics log

IgxGrid 的儲存格編輯範本預設沒有焦點。若要在儲存格編輯開始時聚焦編輯模板,請將IgxFocus 指令附加到儲存格編輯模板中要聚焦的控制項。

<igx-grid #grid1 [data]="data" width="700px"
  height="300px" displayDensity="compact">
  <igx-column field="Id" header="ID" [hidden]="true"></igx-column>
  <igx-column field="Name" header="商品名" [editable]="true">
    <!-- セル編集テンプレート -->
    <ng-template igxCellEditor let-cell="cell">
      <input type="text" [value]="cell.value"
      (change)="cell.update($event.target.value)" style="width: 100%;"
      [igxFocus]="cell.focused"><!-- IgxFocus ディレクティブを添付 -->
    </ng-template>
  </igx-column>
  <igx-column field="Price" header="価格" [editable]="true">
  </igx-column>
  <igx-column field="IsActive" header="アクティブ" [editable]="true"></igx-column>
</igx-grid>

結果

快速跳轉目錄

✦ 群昱 AccessSoft 你的全面軟體解決方案 ✦

身為全球眾多知名軟體在台灣合作夥伴,歡迎諮詢你需要的軟體服務!

Picture of 軟體專家
軟體專家

群昱作為全球知名軟體推薦合作夥伴,致力於提供更多軟體解決方案給你!

更多軟體新知

立即詢價

請留下完整資訊,以便我們提供精確的服務內容給你。

詢價資訊