Arraydataprovider filtering in gridview

I have a simple array that I get into a arraydataprovider to show in the grid view.

However as i do not have a model, i also have no filtermodel.

How do I do filtering for this list now?

Any suggestions ?

$dataProvider = new ArrayDataProvider([

    'allModels' => $arTableList,

    'sort' => [

        'attributes' => ['tablename'],


    'pagination' => [

        'pageSize' => 3000,



Write a search model class for yourself whose ‘search’ method returns an ArrayDataProvider.

In that method you can give the provider the filtered result of array as ‘allModels’.