getSelectedData

Returns the selected elements mapped to objects.

Returns

Array The selected items.

Example

 <div id="grid"></div>
 <a class="k-button" onclick="printSelected()">Select and print</a>
 <script>
        $("#grid").kendoGrid({
            columns: [
                { field: "productName" },
                { field: "category" }
            ],
            dataSource: {
                data: [
                { productName: "Tea", category: "Beverages" },
                { productName: "Coffee", category: "Beverages" },
                { productName: "Ham", category: "Food" },
                { productName: "Bread", category: "Food" }
                ]
            },
            groupable: true,
            selectable: "multiple, cell"
        });

    function printSelected() {
        var grid = $("#grid").data("kendoGrid");
        grid.select($('#grid tbody td').slice(0,2).add($('#grid tbody td').slice(4,6)));

        console.log(grid.getSelectedData());
    }

 </script>
In this article
Not finding the help you need? Improve this article