Kendo网格刷新不会更新值 [英] Kendo grid refresh does not update the values

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

问题描述

我在一个名为 region 搜索频段的页面中有两个kendo网格。区域网格具有列出的所有区域名称的列表,搜索区域具有下拉列表中列出的区域名称以及少数其他字段。



当我们在区域网格中添加新区域时,区域名称应显示在搜索区域下方的下拉列表中。但只有在我们添加新区域后刷新页面时才会发生这种情况。但是我不希望每次添加区域时只刷新搜索带网格以自动刷新,以便在下拉列表中显示新添加的区域名称而不刷新整个页面。



我们在每个网格的末尾都有一个刷新按钮。即使我通过单击按钮手动刷新搜索范围网格,新添加的区域名称也不会显示在下拉列表中。它按预期工作,只有当我刷新整个页面(我们不想要)时,才会显示新添加的区域名称以显示在搜索范围内。



用于刷新搜索带网格的jquery是



 function grid_onSave(data){
data.preventDefault( );
var validator = $('#RegionList')。kendoValidator()。data('kendoValidator');
if(validator.validate()){
var dataItem = {
RegionId:data.model.RegionId,
Name:data.model.Name
};
if(dataItem.RegionId ==){
addRegion(dataItem);
}
else {
editRegion(dataItem);
}
}
//window.location.reload();
$('#SearchBandList')。data('kendoGrid')。dataSource.read();
$('#SearchBandList')。data('kendoGrid')。refresh();
}





任何人都可以帮忙解决这个问题。



我尝试了什么:



我尝试使用上面的jquery似乎不起作用。

解决方案

('#RegionList')。kendoValidator()。data('kendoValidator');
if(validator.validate()){
var dataItem = {
RegionId:data.model.RegionId,
Name:data.model.Name
};
if(dataItem.RegionId ==){
addRegion(dataItem);
}
else {
editRegion(dataItem);
}
}
//window.location.reload();


('#SearchBandList')。data('kendoGrid')。dataSource .read();

( '#SearchBandList')数据( 'kendoGrid')刷新()。;
}





任何人都可以帮忙解决这个问题。



我尝试了什么:



我尝试使用上面的jquery似乎不起作用。


I have got two kendo grid in a page called region and Search band. Where the region grid has the list of all the region names listed and the search band has the region names listed in a drop down along with few other fields.

When ever we add a new region in the region grid the region name should display in the drop down list under the search band. But this happens only if we refresh the page after we add a new region. But I do not want to refresh only the search band grid to refresh automatically each time we add a region so that the newly added region name is displayed in the drop down without refreshing the whole page.

We have got a refresh button at the end of each grid. The newly added region name does not display in the drop down even if I manually refresh the search band grid by clicking on the button. It works as expected to display the newly added region name to display in the search band drop down only if I refresh the whole page(which we don't want).

The jquery used till to refresh the search band grid is

function grid_onSave(data) {
       data.preventDefault();
       var validator = $('#RegionList').kendoValidator().data('kendoValidator');
       if (validator.validate()) {
           var dataItem = {
               RegionId: data.model.RegionId,
               Name: data.model.Name
           };
           if (dataItem.RegionId == "") {
               addRegion(dataItem);
           }
           else {
               editRegion(dataItem);
           }
       }
       //window.location.reload();
       $('#SearchBandList').data('kendoGrid').dataSource.read();
       $('#SearchBandList').data('kendoGrid').refresh();
    }



Can anyone help on how to fix this issue.

What I have tried:

I tried using the above jquery which doesn't seems to work.

解决方案

('#RegionList').kendoValidator().data('kendoValidator'); if (validator.validate()) { var dataItem = { RegionId: data.model.RegionId, Name: data.model.Name }; if (dataItem.RegionId == "") { addRegion(dataItem); } else { editRegion(dataItem); } } //window.location.reload();


('#SearchBandList').data('kendoGrid').dataSource.read();


('#SearchBandList').data('kendoGrid').refresh(); }



Can anyone help on how to fix this issue.

What I have tried:

I tried using the above jquery which doesn't seems to work.


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

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