How to select current page's rows only in ngx data table in angular5










0















I am using ngx-data table and using checkbox type of ngx-data table. I want to select current pages rows only but it when i select-all option so it selects all rows in array. My code is here



<ngx-datatable-column [width]="50" [sortable]="false" [canAutoResize]="false" [draggable]="false" [resizeable]="false">
<ng-template class="datatable-checkbox" ngx-datatable-header-template let-value="value" let-allRowsSelected="allRowsSelected"
let-selectFn="selectFn">
<div class="checkbox-fade fade-in-default datatable-header-cell-label">
<label>
<input type="checkbox" [checked]="allRowsSelected" (change)="selectFn(!allRowsSelected)" />
<span class="cr">
<i class="cr-icon icofont icofont-ui-check txt-primary"></i>
</span>
</label>
</div>
</ng-template>
<ng-template class="datatable-checkbox" ngx-datatable-cell-template let-value="value" let-isSelected="isSelected" let-onCheckboxChangeFn="onCheckboxChangeFn">
<div class="checkbox-fade fade-in-default datatable-header-cell-label">
<label>
<input type="checkbox" [checked]="isSelected" (change)="onCheckboxChangeFn($event)" />
<span class="cr">
<i class="cr-icon icofont icofont-ui-check txt-primary"></i>
</span>
</label>
</div>
</ng-template>
</ngx-datatable-column>


How can i select only current page rows only on select-all option?










share|improve this question




























    0















    I am using ngx-data table and using checkbox type of ngx-data table. I want to select current pages rows only but it when i select-all option so it selects all rows in array. My code is here



    <ngx-datatable-column [width]="50" [sortable]="false" [canAutoResize]="false" [draggable]="false" [resizeable]="false">
    <ng-template class="datatable-checkbox" ngx-datatable-header-template let-value="value" let-allRowsSelected="allRowsSelected"
    let-selectFn="selectFn">
    <div class="checkbox-fade fade-in-default datatable-header-cell-label">
    <label>
    <input type="checkbox" [checked]="allRowsSelected" (change)="selectFn(!allRowsSelected)" />
    <span class="cr">
    <i class="cr-icon icofont icofont-ui-check txt-primary"></i>
    </span>
    </label>
    </div>
    </ng-template>
    <ng-template class="datatable-checkbox" ngx-datatable-cell-template let-value="value" let-isSelected="isSelected" let-onCheckboxChangeFn="onCheckboxChangeFn">
    <div class="checkbox-fade fade-in-default datatable-header-cell-label">
    <label>
    <input type="checkbox" [checked]="isSelected" (change)="onCheckboxChangeFn($event)" />
    <span class="cr">
    <i class="cr-icon icofont icofont-ui-check txt-primary"></i>
    </span>
    </label>
    </div>
    </ng-template>
    </ngx-datatable-column>


    How can i select only current page rows only on select-all option?










    share|improve this question


























      0












      0








      0








      I am using ngx-data table and using checkbox type of ngx-data table. I want to select current pages rows only but it when i select-all option so it selects all rows in array. My code is here



      <ngx-datatable-column [width]="50" [sortable]="false" [canAutoResize]="false" [draggable]="false" [resizeable]="false">
      <ng-template class="datatable-checkbox" ngx-datatable-header-template let-value="value" let-allRowsSelected="allRowsSelected"
      let-selectFn="selectFn">
      <div class="checkbox-fade fade-in-default datatable-header-cell-label">
      <label>
      <input type="checkbox" [checked]="allRowsSelected" (change)="selectFn(!allRowsSelected)" />
      <span class="cr">
      <i class="cr-icon icofont icofont-ui-check txt-primary"></i>
      </span>
      </label>
      </div>
      </ng-template>
      <ng-template class="datatable-checkbox" ngx-datatable-cell-template let-value="value" let-isSelected="isSelected" let-onCheckboxChangeFn="onCheckboxChangeFn">
      <div class="checkbox-fade fade-in-default datatable-header-cell-label">
      <label>
      <input type="checkbox" [checked]="isSelected" (change)="onCheckboxChangeFn($event)" />
      <span class="cr">
      <i class="cr-icon icofont icofont-ui-check txt-primary"></i>
      </span>
      </label>
      </div>
      </ng-template>
      </ngx-datatable-column>


      How can i select only current page rows only on select-all option?










      share|improve this question
















      I am using ngx-data table and using checkbox type of ngx-data table. I want to select current pages rows only but it when i select-all option so it selects all rows in array. My code is here



      <ngx-datatable-column [width]="50" [sortable]="false" [canAutoResize]="false" [draggable]="false" [resizeable]="false">
      <ng-template class="datatable-checkbox" ngx-datatable-header-template let-value="value" let-allRowsSelected="allRowsSelected"
      let-selectFn="selectFn">
      <div class="checkbox-fade fade-in-default datatable-header-cell-label">
      <label>
      <input type="checkbox" [checked]="allRowsSelected" (change)="selectFn(!allRowsSelected)" />
      <span class="cr">
      <i class="cr-icon icofont icofont-ui-check txt-primary"></i>
      </span>
      </label>
      </div>
      </ng-template>
      <ng-template class="datatable-checkbox" ngx-datatable-cell-template let-value="value" let-isSelected="isSelected" let-onCheckboxChangeFn="onCheckboxChangeFn">
      <div class="checkbox-fade fade-in-default datatable-header-cell-label">
      <label>
      <input type="checkbox" [checked]="isSelected" (change)="onCheckboxChangeFn($event)" />
      <span class="cr">
      <i class="cr-icon icofont icofont-ui-check txt-primary"></i>
      </span>
      </label>
      </div>
      </ng-template>
      </ngx-datatable-column>


      How can i select only current page rows only on select-all option?







      javascript angular angular5 ngx-datatable






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 6:23







      Ahsan Alam Siddiqui

















      asked Nov 15 '18 at 6:16









      Ahsan Alam SiddiquiAhsan Alam Siddiqui

      219




      219






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Try to use:



          [selectAllRowsOnPage] true|false


          In ngx docs, it says:




          Property to which you can use for determining select all rows on
          current page or not.







          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313484%2fhow-to-select-current-pages-rows-only-in-ngx-data-table-in-angular5%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Try to use:



            [selectAllRowsOnPage] true|false


            In ngx docs, it says:




            Property to which you can use for determining select all rows on
            current page or not.







            share|improve this answer





























              0














              Try to use:



              [selectAllRowsOnPage] true|false


              In ngx docs, it says:




              Property to which you can use for determining select all rows on
              current page or not.







              share|improve this answer



























                0












                0








                0







                Try to use:



                [selectAllRowsOnPage] true|false


                In ngx docs, it says:




                Property to which you can use for determining select all rows on
                current page or not.







                share|improve this answer















                Try to use:



                [selectAllRowsOnPage] true|false


                In ngx docs, it says:




                Property to which you can use for determining select all rows on
                current page or not.








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 1 at 18:44









                סטנלי גרונן

                1,76482245




                1,76482245










                answered Mar 1 at 17:28









                Guilherme StellaGuilherme Stella

                164




                164





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313484%2fhow-to-select-current-pages-rows-only-in-ngx-data-table-in-angular5%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    Node.js Script on GitHub Pages or Amazon S3

                    Museum of Modern and Contemporary Art of Trento and Rovereto