Kendo Grid Select Team Configuration

Among Edit and Destroy, Kendo Mesh also has a Select command. But there doesn't seem to be any configuration for this operation. Do you know how I can use it? Any better way to bind JS as custom commands? Please note that it has no event click

.

This line is in my Kendo section, in columns.

columns.Command(command => { command.Select(); command.Edit(); command.Destroy(); });

      

+3


source to share


2 answers


Well I found a better way than using a custom command.

Custom command inside the grid:

command.Custom("select").Text("Select").Click("select");

      



and the JS handler code:

<script>
    function select(e) {
        var grid = $("#grid").data("kendoGrid");
        var item = grid.dataItem(grid.select());
        var data = item.Title;
        alert(data);
    }
</script>

      

+5


source


Another way to call this:



  function select(e){
    var row = $(e.currentTarget).closest("tr");
    var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
    alert(dataItem.Title);
 }

      

+1


source







All Articles