文章分類/Infragistics
igGrid 中的預設行為是在編輯時根據資料類型自動產生編輯器,但您也可以使用組合方塊作為編輯器。下面是一個實作範例。
$("#gridProducts").igGrid({ ... columns: [ { headerText: "", key: "ID", dataType: "number", hidden: true }, { headerText: "メーカー", key: "Manufacturer", dataType: "string", width: "20%" }, { headerText: "名前", key: "Name", dataType: "string", width: "20%" }, { headerText: "説明", key: "Description", dataType: "string", width: "30%" }, { headerText: "カテゴリ", key: "CategoryID", dataType: "number", width: "30%", formatter: formatCategoryCombo } ], features: [ { name: 'Updating', columnSettings: [{ //The combo is defined as an editor provider. Combo options are defined under 'editorOptions'. columnKey: "CategoryID", editorType: 'combo', required: true, editorOptions: { mode: "dropdown", dataSource: northWindCategoriesJSON, textKey: "Name", valueKey: "ID" } }], ... }, ... ] });