yii2-widget-datatables
yii2-widget-datatables copied to clipboard
Using yii pagination
After #2 It is necessary the implementation of a pagination in the php layer to avoid memory limit errors.
I believe making it working like GridView (pagination and filters) will be great. Right now it loads all data with pagination being false and filters does not work as Yii2 GV.
Especially loading all data once forced me to rollback all uses of this extension (and datatables all together since this was the most compatible extension to GV).
I will try to fix when I have time (currently I don't have) but if you find time to fix it will be great!
в модели
$dataProvider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ 'totalCount' => $query->count(), 'pageSize' => 10, ], ]);
$query->offset($dataProvider->pagination->offset)->limit($dataProvider->pagination->limit)->all();