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

pagination also got exported into CSV #5

Open
ferry77 opened this issue Apr 16, 2014 · 4 comments
Open

pagination also got exported into CSV #5

ferry77 opened this issue Apr 16, 2014 · 4 comments

Comments

@ferry77
Copy link

ferry77 commented Apr 16, 2014

I use ngTable 0.3.2 and ngTableExport 0.1.0 installed using bower, when click export the output also include pagination in CSV file

10 25 50 100 « 1 2 »

where is my mistake?

<>

            <td data-title="'Group Name'" filter="{ 'name': 'text' }" sortable="'name'">{{item.name}}</td>
            <td data-title="'Group Email'">{{item.email}}</td>
            
        </tr>
        </tbody>
    </table>

<>

$scope.tableParams = new ngTableParams({
page: 1, // show first page
count: 10, // count per page
filter: {
name: '' // initial filter
}
}, {
total: objects.bookings.length, // length of objects.bookings
getData: function($defer, params) {
// use build-in angular filter
var filteredData = params.filter() ?
$filter('filter')(objects.bookings, params.filter()) :
objects.bookings;
var orderedData = params.sorting() ?
$filter('orderBy')(filteredData, params.orderBy()) :
objects.bookings;

            params.total(orderedData.length); // set total for recalc pagination
            $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
        }
    });
@Bhaall
Copy link

Bhaall commented Apr 28, 2014

I changed the row selectors to not include tfoot:
var rows = element.find('tr').not('tfoot tr');

Original
var rows = element.find('tr');

@fizerkhan
Copy link

@Bhaall Thanks.

@minirobotdan
Copy link

Any plans to merge that change?

@floydpink
Copy link

Since this repo was not being updated, we forked it and would welcome suggestions like these that could improve the library.

Check out https://github.com/kollavarsham/ng-table-to-csv

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

5 participants