This is a migrated thread and some comments may be shown as answers.

Call to Kendo Grid in Then of Promise fails

1 Answer 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Beryl
Top achievements
Rank 1
Beryl asked on 11 Aug 2017, 07:32 PM

I am using Kendo Grid with Angular.  I need to call the grid only after the return of a promise.  However, placing a call to the grid in the "THEN" causes the grid to never load.  Even if I make a direct call to dataSource.read();  it will not read the datasource.

 

Here is my code:

 

  function initialize() {
      var savedSearchCriteria;
      var promise = isFiltered();
      promise.then(function() {
          savedSearchCriteria = $window.localStorage.getItem('pecGeneralSearchCriteria');
      }).then(function () {
            searchGrid();
      });
  };

A call to searchGrid() outside of the "THEN" for the promise works fine.

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 15 Aug 2017, 05:44 PM
Hello Beryl,

I would need some more of the code in the application to get a good idea why you are unable to get the Kendo UI Grid reference in the promise.

Here is an article which shows how to get widget references in an AngularJS application. Could you share the searchGrid() function as well as the grid configuration and the HTML element from which it is initialized?

Look forward to hearing back from you.

Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Beryl
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or