Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ignite ui 在IgGrid加载后,如何为特定列设置allowSorting false?_Ignite Ui - Fatal编程技术网

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

Ignite ui 在IgGrid加载后,如何为特定列设置allowSorting false?,ignite-ui,Ignite Ui,我已经将这个网格下初始化作为一个通用函数进行了全球化。我已经使用排序作为所有列的默认值。我需要在IgGrid加载后为特定列设置allowSorting。我在这里添加了一个示例代码。我无法在此变量colSettings中设置allowSorting $("#gridSorting").igGrid({ primaryKey: "ProductID", columns: [ { headerText: "Produc

我已经将这个网格下初始化作为一个通用函数进行了全球化。我已经使用排序作为所有列的默认值。我需要在IgGrid加载后为特定列设置allowSorting。我在这里添加了一个示例代码。我无法在此变量colSettings中设置allowSorting

      $("#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);

请告诉我如何为本例中的特定列设置allowSorting:false。

在调用示例中的sorting setOption后,您是否能够对ProductNumber列进行排序?我已经对此进行了测试,一切正常。也许你使用的是早期版本?