How to set allowSorting false for particular column after IgGrid getting loaded?

616 Views Asked by At

I have globalized this below Grid initialization as a common function. I have used sorting as default for all columns. I need to set "allowSorting" for particular column after IgGrid getting loaded. I have added a sample code here. I am unable to set "allowSorting" in this variable "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);

Please advise me how to set "allowSorting: false" for particular column in this example.

0

There are 0 best solutions below