搜索kendo网格后,数据绑定不会发生 [英] Databinding is not happening after search kendo grid

查看:162
本文介绍了搜索kendo网格后,数据绑定不会发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Kendo网格和一些数据。当我尝试调用重新绑定,即使我能够从我的数据库中获取数据,它也不会填充数据。



以下是明确的步骤:


  1. 通过调用我的函数来绑定数据init()

  2. 在我的Init()中, :/ Emps / ShowAllEmps

  3. 首次加载数据,我可以在网格中看到

  4. 现在我有一个文本

  5. 我已经输入了一些文本,并调用了相同的数据源,如/ Emps / ShowAllEmps,附加参数

  6. 当我点击搜索按钮,我可以根据我的输入获取数据,我可以看到网格。

  7. 现在,当我点击重置按钮,我想调用相同的数据源,如/ Emps / ShowAllEmps,清除所有参数。

  8. 现在我的数据源可以执行读取操作,我可以在我的firebug中看到数据为JSON对象。

  9. 但问题是现在,它没有绑定到我的网格。事件数据在JSON对象中。

任何想法?或者有人有类似的例子可以发布吗?



谢谢

解决方案

尝试刷新数据源读取后的网格数据读取不会刷新UI,它只是从指定的读取操作获取数据。

  $(# grid1)。data('kendoGrid')。dataSource.read(); 
$(#grid1)。data('kendoGrid')。refresh();


Hi I've a Kendo grid with some data. When I try to call rebind it is not populating data even though I can able to fetch it from my db.

Here are the clear steps:

  1. Binding data by calling my function init()
  2. In my Init() I've datasource with read like this read: "/Emps/ShowAllEmps"
  3. First time it is loading data and I can able to see in the grid
  4. Now I've a text box in my page along with search button.
  5. I've entered some text and calling the same datasource like "/Emps/ShowAllEmps" with additional parameters
  6. When I click on search button, I can able to fetch data based on my input and I can able to see on the grid.
  7. Now when I click on reset button, I want to call the same datasource like "/Emps/ShowAllEmps" with clearing all parameters.
  8. Now my datasource can able to perform read operation and I can able to see the data as JSON object in my firebug.
  9. But the problem is now, it is not binding to my grid. Eventhough data is there in JSON object.

Any idea? or someone is having similar example can you post it? So that I can reffer.

Thanks

解决方案

Try refreshing the grid after datasource read.Datasource read doesnot refreshes the UI it just gets the data from the read action specified.

$("#grid1").data('kendoGrid').dataSource.read();
$("#grid1").data('kendoGrid').refresh();

这篇关于搜索kendo网格后,数据绑定不会发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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