kendo-labs / angular-kendo

A project to create a robust set of Angular.js bindings for Kendo UI widgets
474 stars 209 forks source link

Reload event on Angular-Kendo grid #386

Open farturi opened 10 years ago

farturi commented 10 years ago

I have a grid with Angular and Kendo like as example page. It's possible to reload the grid by clicking an external button ? And apply some filter by taking the value of an external text box?

Is there an example of how to do that?

Thank you very much.

lijuenc commented 10 years ago

To refresh the grid, you need to get a reference to its element and call some methods on it. It's pretty ugly, but if you keep this logic in a service you can keep the ugly in one spot.

var gridEl = angular.element('#myGridElement');
gridEl.data('kendoGrid').dataSource.read();
gridEl.data('kendoGrid').refresh();

To take external values as parameters, you need to use a custom transport.read/create/update method. Inside this method, you merge your external values with Kendo's. http://docs.telerik.com/kendo-ui/api/framework/datasource#configuration-transport