Kendo grid: How to check all checkboxes of selected rows?

十年热恋 提交于 2019-12-03 20:49:26

Your example seems to work : http://jsfiddle.net/scaillerie/axpmF/ .

You just have to set your grid as a kendoGrid by adding at the beginning of your document.ready event :

$('#Grid').kendoGrid();

and to be sure that there is a checkbox in all last cells of your table...


EDIT :

For updating the state of the checkboxes in the selected rows, you have to register the event dblclick on each cell of the grid:

grid.tbody.on("dblclick", "tr", selectAllSelectedRows);

function selectAllSelectedRows() {
    grid.tbody.find("tr").each(function() {
        var $this = $(this),
            ckbox,
            state;

        if($this.hasClass("k-state-selected")) {
            ckbox = $this.find("td:last input");
            state = ckbox.prop("checked");
            ckbox.prop("checked", !state);   
        }
    })
}

I have updated my fiddle with the new code : http://jsfiddle.net/scaillerie/axpmF/2/ .

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!