如何在IgGrid加载后为特定列设置allowSorting false?

时间:2014-12-15 06:09:50

标签: ignite-ui

我将以下网格初始化全局化为常用功能。我已经使用排序作为所有列的默认值。我需要设置" allowSorting"对于IgGrid加载后的特定柱。我在这里添加了示例代码。我无法设置" allowSorting"在这个变量" colSettings"。

      $("#gridSorting").igGrid({
            primaryKey: "ProductID",
            columns: [
            { headerText: "Product ID", key: "ProductID", dataType: "number" },
            { headerText: "Product Name", key: "Name", dataType: "string", template: '<a id="name${ProductID}">${Name}</a>' },
            { headerText: "Product Number", key: "ProductNumber", dataType: "string", template: '<input type="text" class="txtBox" id="${ProductID}" value="" />' },
            { headerText: "Product Key", key: "ProductKey", dataType: "string", template: '<input type="text" class="txtBox1" maxlength="4" id="${ProductKey}" value="${ProductKey}" />' }
        ],
            features: [
            {
                name: "RowSelectors",
                enableCheckBoxes: true,
                enableRowNumbering: false
            },
            {
                name: "Selection",
                mode: 'row',
                multipleSelection: true

            },
            {
                name: "Sorting",
                type: "local"
            }
        ],
            width: "500px",
            dataSource: products
        });

        var colSettings = [
                    {
                        columnKey: 'ProductID',
                        allowSorting: true
                    },
                    {
                        columnKey: 'Name',
                        allowSorting: true
                    },
                    {
                        columnKey: 'ProductNumber',
                        allowSorting: false
                    }
            ];

        $("#gridSorting").igGridSorting("option", "columnSettings", colSettings);

请告诉我如何设置&#34; allowSorting:false&#34;对于此示例中的特定列。

0 个答案:

没有答案