Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple instances of scroller not working #85

Open
omer-sds opened this issue Jul 20, 2017 · 2 comments
Open

Multiple instances of scroller not working #85

omer-sds opened this issue Jul 20, 2017 · 2 comments

Comments

@omer-sds
Copy link

multiple instances of the scroller are not working i am using yii tabs widget and rendring 2 different views inside both of the tabs but the first tab has the pager loaded , and working whereas the second tab doesnot show load more button

i am loading the tabs like this

<?=
                        Tabs::widget ( [
                            'navType' => 'nav-tab' ,
                            'items' => [
                              
                                [
                                    'label' => 'Properties' ,
                                    'content' => $this->render ( '_properties' , ['dataProvider' => $dataProviderListing ] ) ,
                                ] ,
                                [
                                    'label' => 'Reviews' ,
                                    'content' => $this->render ( '_reviews' , ['dataProvider' => $dataProviderReviews , 'profile' => $profile , 'review' => $review ] ) ,
                                ] ,
                            ]
                        ] );
                        ?>

_properties.php

ListView::widget ( [
    'dataProvider' => $dataProvider ,
    'emptyText' => '<div class="text-center listings-grid__item"><span class="label label-danger">No Properties Added yet</span></div>' ,
    'options' => [
        'tag' => 'div' ,
        'class' => 'listings-list listings-list--alt' ,
        'id' => 'list-wrapper' ,
    ] ,
    'itemOptions' => ['class' => 'loader-class' ] ,
    'layout' => "{items}{pager}" ,
    'pager' => [
        'class' => ScrollPager::className () ,
        'container' => '#list-wrapper' ,
        'item' => '.loader-class' ,
        'paginationSelector' => '#list-wrapper>.pagination' ,
        'next' => '.next a' ,
        'historyPrev' => 'li.prev>a' ,
        'noneLeftText' => 'No more Listings to display.' ,
        'noneLeftTemplate' => '<div class="no-more col-sm-12"><span>{text}</span></div>' ,
        'triggerText' => 'Load More Listings' ,
        'triggerTemplate' => '<div class="load-more"><a href="javascript:void(0)"><i class="zmdi zmdi-refresh-alt"></i> {text}</a></div>' ,
    ] ,
  
] );
?>

_reviews.php

<?=
        ListView::widget ( [
            'dataProvider' => $dataProvider ,
            'emptyText' => '<div class="text-center listings-grid__item"><span class="label label-danger">No Reviews received yet</span></div>' ,
            'options' => [
                'id' => 'review-wrapper' ,
            ] ,
            'itemOptions' => ['class' => 'loader-class-review' ] ,
            'layout' => "{items}{pager}" ,
            'pager' => [
                'class' => ScrollPager::className () ,
                'container' => '#review-wrapper' ,
                'item' => '.loader-class-review' ,
                'paginationSelector' => '#review-wrapper>.pagination' ,
                'next' => '#review-wrapper .pagination li.next a' ,
                'historyPrev' => '#review-wrapper .pagination li.prev>a' ,
                'noneLeftText' => 'No more Listings to display.' ,
                'noneLeftTemplate' => '<div class="no-more col-sm-12"><span>{text}</span></div>' ,
                'triggerText' => 'Load More Reviews' ,
                'triggerTemplate' => '<div class="load-more"><a href="javascript:void(0)"><i class="zmdi zmdi-refresh-alt"></i> {text}</a></div>' ,
                'eventOnRendered' => new \yii\web\JsExpression ( 'function(){var optVar = $("div.agent-reviews__item input").attr("data-krajee-rating");options = window[optVar];$("div.agent-reviews__item input").rating(options);}' )
            ] ,
           
        ] );
        ?>
@kimhongn89
Copy link

I have the same issue when using it in multiple listview, it just worked with one

@rohanmashiyava
Copy link

Not working. @kop Can you please update us on this how we can achieve this or what exactly the culprit is. If you can guide me through here and allow me fork I can do the rest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants