Dataprovier With Custom Data

Hello everybody.

I have a problem with grid (doesn’t metter CGridView or yii\grid\GridView). Imagine, that you have about 9 millions records per table, and we need to provide interface for it. We need to filer data, sort (for several columns) and, of course, pagination.

And… we get this data via REST or some custom API. So, we can’t use CActiveDataProvider and CSQLDataProvider.

The last provider is CArrayDataProviders, but its neet to take ALL data at once, because it makes sorting by itself (instead sorting by REST-parameter).

If you give to CArrayDataProvider only part of its data, its brokes pagination.

Do you have any idea, how to work with REST and GridView?

Is making your own provider the only way?

Yes, you should extend one of the built in providers and replace the methods fetching data to make a REST call.

Ok, it make sense, thanks.