pagination is not working if i m using arraydataprovider and in this i m passing query that is custom array
$provider = new ArrayDataProvider([
'key' => 'id', 'allModels' => $retVal, 'pagination' => [ 'pageSize' => 50, ],
here $retVal array is custom array not coming from database directly
and in this i have following
[key] => id [allModels] => Array (  => Array ( [id] => 1 [time] => 03-05-2015 14:43:15 [speed] => 31 Km/hr [address] =>'' )
in grid on first page it is showing fine but when i click on 2nd page data lost,nothing is coming.
i dont know where is my mistake or i m missing some setting.
plz i need help on this