Refresh a single Kendo grid row

后端 未结 4 1392
一生所求
一生所求 2020-12-23 16:45

Is there a way to refresh a single Kendo grid row without refreshing the whole datasource or using jQuery to set the value for each cell?

4条回答
  •  情深已故
    2020-12-23 17:17

    How do you define the row that you want to update? I'm going to assume that is the row that you have selected, and the name of the column being updated is symbol.

    // Get a reference to the grid
    var grid = $("#my_grid").data("kendoGrid");
    
    // Access the row that is selected
    var select = grid.select();
    // and now the data
    var data = grid.dataItem(select);
    // update the column `symbol` and set its value to `HPQ`
    data.set("symbol", "HPQ");
    

    Remember that the content of the DataSource is an observable object, meaning that you can update it using set and the change should be reflected magically in the grid.

提交回复
热议问题