src/Lister.php
public function addJsPaginator($ipp, $options = [], $container = null, $scrollRegion = null)
    {
        $this->ipp = $ipp;
        $this->jsPaginator = $this->add(['jsPaginator', 'view' => $container, 'options' => $options]);

        // set initial model limit. can be overwritten by onScroll
        $this->model->setLimit($ipp);

        // add onScroll callback
        $this->jsPaginator->onScroll(function ($p) use ($ipp, $scrollRegion) {
            // set/overwrite model limit
            $this->model->setLimit($ipp, ($p - 1) * $ipp);

            // render this View (it will count rendered records !)
            $json = $this->renderJSON(true, $scrollRegion);

            // if there will be no more pages, then replace message=Success to let JS know that there are no more records
            if ($this->_rendered_rows_count < $ipp) {
                $json = json_decode($json, true);
                $json['message'] = 'Done'; // Done status means - no more requests from JS side
                $json = json_encode($json);
            }

            // return json response
            $this->app->terminate($json);
        });

        return $this;
    }
public function addJsPaginator($ipp, $options = [], $container = null, $scrollRegion = null)
    {
        $this->ipp = $ipp;
        $this->jsPaginator = $this->add(['jsPaginator', 'view' => $container, 'options' => $options]);

        // set initial model limit. can be overwritten by onScroll
        $this->model->setLimit($ipp);

        // add onScroll callback
        $this->jsPaginator->onScroll(function ($p) use ($ipp, $scrollRegion) {
            // set/overwrite model limit
            $this->model->setLimit($ipp, ($p - 1) * $ipp);

            // render this View (it will count rendered records !)
            $json = $this->renderJSON(true, $scrollRegion);

            // if there will be no more pages, then replace message=Success to let JS know that there are no more records
            if ($this->_rendered_rows_count < $ipp) {
                $json = json_decode($json, true);
                $json['message'] = 'Done'; // Done status means - no more requests from JS side
                $json = json_encode($json);
            }

            // return json response
            $this->app->terminate($json);
        });

        return $this;
    }
public function addJsPaginator ( $ ipp , $ options = [ ] , $ container = null , $ scrollRegion = null ) { $ this -> ipp = $ ipp ; $ this -> jsPaginator = $ this -> add ( [ 'jsPaginator' , 'view' => $ container , 'options' => $ options ] ) ; // set initial model limit. can be overwritten by onScroll $ this -> model -> setLimit ( $ ipp ) ; // add onScroll callback $ this -> jsPaginator -> onScroll ( function ( $ p ) use ( $ ipp , $ scrollRegion ) { // set/overwrite model limit $ this -> model -> setLimit ( $ ipp , ( $ p - 1 ) * $ ipp ) ; // render this View (it will count rendered records !) $ json = $ this -> renderJSON ( true , $ scrollRegion ) ; // if there will be no more pages, then replace message=Success to let JS know that there are no more records if ( $ this -> _rendered_rows_count < $ ipp ) { $ json = json_decode ( $ json , true ) ; $ json [ 'message' ] = 'Done' ; // Done status means - no more requests from JS side $ json = json_encode ( $ json ) ; } // return json response $ this -> app -> terminate ( $ json ) ; } ) ; return $ this ; }
Add Dynamic paginator when scrolling content via Javascript.
Will output x item in lister set per ipp until user scroll content to the end of page.
When this happen, content will be reload x number of items.

@param int    $ipp          Number of item per page
@param array  $options      An array with js Scroll plugin options.
@param View   $container    The container holding the lister for scrolling purpose. Default to view owner.
@param string $scrollRegion A specific template region to render. Render output is append to container html element.

@throws Exception

@return $this|void
Add Dynamic paginator when scrolling content via Javascript . Will output x item in lister set per ipp until user scroll content to the end of page . When this happen content will be reload x number of items .