tecnocen-com / yii2-bootstrap-year-calendar

Yii2 widget for bootstrap-year-calendar plugin
Other
13 stars 3 forks source link

Display a limited number of entries #7

Open s1lver opened 6 years ago

s1lver commented 6 years ago

Hi! @Faryshta @neverabe The widget displays the default number of records equal to that set in the inherited "dataProvider". This number is equal to 20.

The solution to the problem is setting the limit while forming the "dataProvider".

new ActiveDataProvider([
    'query' => self::find(),
    'pagination' => [
        'pageSize' => 365,
    ],
])

However, this is not quite the right decision. How much should I set? 365? Then it will be only for a year, and if it is necessary for the previous year, or next year?

Corrections:

If necessary I will send pull request.

Faryshta commented 6 years ago

The limit is for the amount of events you are expecting. If you want to handle a huge amount of events I advice you to combine PJax and this widget to display the results month by month.

If you have another idea do send pr