刷新单个Kendo网格行 [英] Refresh a single Kendo grid row

查看:65
本文介绍了刷新单个Kendo网格行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种刷新单个Kendo网格行而不刷新整个数据源或使用jQuery为每个单元格设置值的方法?

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?

推荐答案

如何定义要更新的行?我将假设这是您选择的行,并且要更新的列的名称为symbol.

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");

请记住,DataSource的内容是一个observable对象,这意味着您可以使用set更新它,并且更改应神奇地反映在grid中.

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.

这篇关于刷新单个Kendo网格行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆