Completed
Last Updated: 25 Nov 2021 11:42 by ADMIN
Wolfgang
Created on: 03 May 2016 18:12
Category: Grid
Type: Feature Request
1
Fix returned rows for grid select() method for grouped data used in grid that is configured with groupable = false.
in a grid configured to groupable = false using a datasource that is grouped will allow selecting a grouping row, it does not show in the ui, but the select() method will return the grouping row. 

demo: 
http://dojo.telerik.com/aDevo

code: 
<!-- shows problem with select() in grid where dataSource is grouped and groupable is disabled -->
<!-- in the demo it is possible to select the grouping row which is not shown but select() returns the grouping row as selected, the problem is even worse if using multiselect with ctrl and clicking on the grouping row -->

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Kendo UI Snippet</title>

    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.common.min.css"/>
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.rtl.min.css"/>
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.silver.min.css"/>
    <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2016.1.412/styles/kendo.mobile.all.min.css"/>

    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://kendo.cdn.telerik.com/2016.1.412/js/kendo.all.min.js"></script>
</head>
<body>
  
<div id="grid"></div> 
<script>

                                      
var dataSource = new kendo.data.DataSource({
  data: [
        { productName: "Tea", category: "Beverages" },
        { productName: "Coffee", category: "Beverages" },
        { productName: "Ham", category: "Food" },
        { productName: "Bread", category: "Food" }
  ],
  group: { field: "productName" }
});                                      
$("#grid").kendoGrid({
    selectable: "multiple, row",
    allowCopy: true,
  	groupable: false,  	
    columns: [
        { field: "productName" },
        { field: "category" }
    ],
  	change: function (e) {
      console.log("number of selected items: " + e.sender.select().length );
    },
    dataSource: dataSource,
});
</script>
</body>
</html>
0 comments