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

Sorting with Observable<GridDataResult>

3 Answers 1125 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pratap
Top achievements
Rank 1
Pratap asked on 20 Jun 2017, 07:27 PM
The example for the Kendo UI Grid for Angular 2 shows how to implement sorting with an array fed into a GridDataResult as your data source, but what is the correct way to implement sorting when using an Observable as your datasource? I'm able to map my Observable<stuff[]> to a Observable<GridDataResult> but not clear on where to inject sorting in that process.

3 Answers, 1 is accepted

Sort by
0
Pratap
Top achievements
Rank 1
answered on 20 Jun 2017, 08:25 PM
Nevermind, it appears to be because the built in orderBy function can't sort my array of custom objects.
0
Pratap
Top achievements
Rank 1
answered on 20 Jun 2017, 09:10 PM
Nope, I definitely still need help with this. No idea what the correct path is to inject sorting mid-stream into an observable data source for the grid.
0
Dimiter Topalov
Telerik team
answered on 22 Jun 2017, 11:05 AM
Hello Pratap,

In general you can use the built-in Angular "async" pipe to display the data from an observable directly in the Grid. Please check out the following examples of sortable Grids retrieving data via a remote data service:

http://www.telerik.com/kendo-angular-ui/components/grid/data-binding/#toc-data-binding-basics

http://www.telerik.com/kendo-angular-ui/components/grid/editing/editing-reactive-forms/

I hope this helps, but if I am missing something, please send us a similar isolated runnable project where the described issue with displaying the sorted data can be observed, so we can inspect it further, and determine what might be causing it. Thank you in advance.

Regards,
Dimiter Topalov
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
Pratap
Top achievements
Rank 1
Answers by
Pratap
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or