【发布时间】:2013-12-05 07:05:19
【问题描述】:
这是我将数据加载到 Kendo Grid 中的代码:
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.CountryName);
columns.Bound(p => p.CountryCode);
columns.Bound(p => p.CountryCodeLength);
columns.Bound(p => p.CurrencyString);
columns.Bound(p => p.CountryISOName);
})
.Pageable(p =>
{
p.Enabled(true);
p.PageSizes(new int[] { 10, 20, 30, 40, 50 });
})
.Sortable()
.Selectable()
.Groupable()
.Scrollable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.ID))
.Read(read => read.Action("Country_Read", "Country")).PageSize(10)
)
.Events(events => events.Change("GridChange"))
.ToolBar(toolbar =>
{
toolbar.Template(
@<text>
<div id="Toolbar">
<a id="Add" href="@Url.Action("Create", "Country")" title="Add New Record"></a>
<a id="Edit" title="Edit Selected Record"></a>
<a id="Delete" title="Delete Selected Record"></a>
</div>
</text>);
})
)
如何在 10-15 秒内定期刷新 CountryCodeLength 列?
我尝试刷新整个网格,但我有一些弹出窗口要在同一个网格内打开。因此,在使用弹出窗口刷新完整网格时,弹出窗口将丢失。
请告诉我如何刷新单个列?
这是我用来刷新整个网格的代码:
$(document).ready(function()
{
var refreshId = setInterval( function() {
//GET YOUR GRID REFERENCE
var grid = $("#Grid").data("kendoGrid");
grid.dataSource.read();
}, 5000);
});
【问题讨论】:
标签: html asp.net-mvc-4 kendo-ui grid refresh