Databinding is not happening after search kendo gr

2019-08-30 01:49发布

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条回答
老娘就宠你
2楼-- · 2019-08-30 02:14

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();
查看更多
登录 后发表回答