mercredi 3 juillet 2019

How can I get the selected checkbox in kendo grid?

I have Kendogrid grid that I get the data by JSON for the URL that I have and activate Selection mode as I found the kendo grid documentation, but I am trying to get the selected data from kendo grid, try some methods in javascript but not yet I have been able to do it. If someone can help me?

$(document).ready(function () {
    $("#grid").kendoGrid({
        toolbar: ["excel"],
        excel: {
            fileName: "user.xlsx",
            filterable: true
        },
        dataSource: {
            transport: {
                read: {
                    url: `/user`
                }
            },
            schema: {
                data: function (response) {
                    return response.permisos;
                },
                model: {
                    fields: {
                        id: { type: "number" },
                        nombre: { type: "string" },
                        descripcion: { type: "string" }
                    }
                }
            },
            pageSize: 20
        },
        height: 550,
        scrollable: false,
        sortable: true,
        filterable: true,
        pageable: true,
        persistSelection: true,
        change: onChange,
        columns: [
            { selectable: true, width: "50px" },
            { field: "id", title: "Id" },
            { field: "nombre", title: "Nombre" },
            { field: "descripcion", title: "Descripción" }
        ]
    });
    $("#grid").data("kendoGrid").wrapper.find(".k-grid-header-wrap").off("scroll.kendoGrid");
});

Aucun commentaire:

Enregistrer un commentaire