文章分類/

Infragistics|Ignite UI for jQuery|使用組合框編輯 igGrid 單元格

尚無瀏覽量
2023-09-28 更新

infragistics log

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"
                }
            }],
            ...
        },
        ...
    ]
});

快速跳轉目錄

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

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

Picture of 軟體專家
軟體專家

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

更多軟體新知

立即詢價

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

詢價資訊