This is a migrated thread and some comments may be shown as answers.

not selectable column

1 Answer 339 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CH
Top achievements
Rank 1
CH asked on 25 Aug 2013, 04:16 PM
Hi, 

I have a check box in one of the column, how can i make the column not selectable for the row?

thanks.

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Aug 2013, 01:24 PM
Hello,

Please try with the below code snippet.

<div id="grid">
</div>
<script>
 
    function onChange(arg) {
        var selected = $.map(this.select(), function (item) {
            if ($(item).find('.myclass').length == 1) {
                $(item).removeClass('k-state-selected');
            }
        });
    }
 
    $(document).ready(function () {
 
        $("#grid").kendoGrid({
            dataSource: {
                type: "odata",
                transport: {
                    read: "http://demos.kendoui.com/service/Northwind.svc/Orders",
                    dataType: "jsonp"
                },
                pageSize: 5
            },
            selectable: "multiple cell",
            pageable: {
                buttonCount: 5
            },
            change: onChange,
            scrollable: false,
            navigatable: true,
            columns: [
                                { field: "OrderID", title: "Order ID", width: 60 },
                                { field: "CustomerID", title: "Customer ID", width: 90 },
                                { field: "ShipName", title: "Ship Name", width: 220 },
                                { field: "ShipAddress", title: "Ship Address", width: 280 },
                                { field: "ShipCity", title: "Ship City", width: 110 },
            //{ field: "ShipCountry", title: "Ship Country", width: 110 },
                                {
                                field: "ShipCountry",
                                title: "Ship Country",
                                width: 110,
                                template: '<input type="checkbox" class="myclass"></input>'
                            }
 
                            ]
        });
 
    });
</script>


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
CH
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or