Databinding is not happening after search kendo grid

人盡茶涼 提交于 2019-12-12 04:58:11

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/25746115/databinding-is-not-happening-after-search-kendo-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!