Revision #209                                    has been created by 
 rackycz                                    on Jul 3, 2020, 12:47:50 PM with the memo:
                                
                                
                                    GridViev - Variable page size                                
                                                                    « previous (#208)                                                                                                    next (#210) »                                                            
                            Changes
                            
    Title
    unchanged
    Yii v2 snippet guide
    Category
    unchanged
    Tutorials
    Yii version
    unchanged
    2.0
    Tags
    unchanged
    tutorial,beginner,yii2
    Content
    changed
    [...]
class InvoiceSearch extends Invoice
{
  public $pageSize = null // add this row
  // ...
  
  // This method already exists:
 
  public function rules()
  {
    return [ // ...[...]
}
    
    // This functionmethod already exists
, so change it:
    public function search($params)
    {
        // 
..Remember to call load() first and then you can work with pageSize
        $this->load($params);
        
        // Add following rows:
        if (!isset($this->pageSize)) {
          // Here we make sure that the dropDownLst will have correct value preselected[...]