ExportCsv with filter

UI Components for Angular
Post Reply
ak21
Posts: 7
Joined: 12 Jan 2017, 12:39

12 Jan 2017, 13:19

Hello.
I need help.
I have a table:

Code: Select all

        <p-dataTable appendTo="body"
                     [value]="items"
                     [rows]="10"
                     [paginator]="true"
                     [responsive]="true"
                     [globalFilter]="gb"
                     [rowStyleClass]="rowStyle" #dt>
          <p-column field="fullName" sortable="true"></p-column>
          <p-column field="id" sortable="true"></p-column>
          <p-column field="vehicle" sortable="true"></p-column>
          <p-column field="email" sortable="true"></p-column>
        </p-dataTable>
and global Filter

Code: Select all

<div class="row">
      <div class="col-md-3 col-xs-12">

        <input #gb type="text" pInputText placeholder="Search">

      </div>
      <div class="col-md-8 col-xs-12">

      </div>
      <div class="col-md-1 col-xs-12 text-right">

        <i class="fa fa-file-excel-o fa-2x" (click)="dt.exportCSV()" aria-hidden="true"></i>

      </div>
    </div>
I apply a filter, but when I click export, I have the entire table without filter. How do I apply a filters to export?

ak21
Posts: 7
Joined: 12 Jan 2017, 12:39

02 Feb 2017, 09:06

Can Anybody Help Me?
How to export only filtered values?

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4344
Joined: 16 Oct 2011, 19:19
Location: Singapore

02 Feb 2017, 09:39

Normally we won't export filter inputs in the document.Also check PrimeFaces CSV example.You need to customize exportCSV with filters object values.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

prafulkusugal
Posts: 1
Joined: 09 Sep 2019, 09:02

09 Sep 2019, 09:04

Anyone any solution for this issue??

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests