Coder Social home page Coder Social logo

ng-table-export's Introduction

Export to CSV format for table

Code licensed under New BSD License.

Installing via Bower

bower install ng-table-export

Example

ng-table-export's People

Contributors

esvit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ng-table-export's Issues

pagination also got exported into CSV

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()));
        }
    });

csv file download

i have download csv files but some empty row restriction how?
remarks & details rows restricted
Eg:
test

Exported file used ";" instead of "," as separator

When opening the file with Excel on a Mac, it works just fine, but on a PC, Excel expects the separator to be a comma, not a semicolon.

An easy fix is to change a line in the code such as to insert 'sep=;' at the very top of the file. Then it works fine both on Excel Mac and Windows.

generate: function() {
    data = 'sep=;' + "\n";

export only checked

Hi!

it would be great if export can works with some additional features
for example export only checked items

I`ll try to add it, but maybe you can say me where is do it better?
...

5 min later :)

we can pass some argumets to generate()

ng-mousedown="csv.csv.generate({
  quotes: '"',
  delimeter: ';',
  headers: true,
  data: 'all' | 'filter' | 'check'
})"

so how get aplyed filter data?

and how get aplyed checkers?

as I understand this code - to skip headers?
https://github.com/esvit/ng-table-export/blob/master/src/scripts/00-directive.js#L26

...
   if (tr.hasClass('ng-table-filters')) {
    return;
   }
...

PS
nice addon for ng-table, let`s do it together better

Export without pagination

I'm using ng-table 0.3.1 with ng-table-export master branch. When I export to csv I only get the results of the page and count that has been selected. I would like to download the full result set, not just the current page that is being displayed.

Ideally could the export trigger the ngTableParams.getData function with a parameter indicating it's a csv export. I could then choose to paginate or not.

Need full/filtered table dataset without pagination

hi, i need full/filtered dataset of ng-table (with pagination),

so that i can use it to export file as pdf. please provide a sample how i can make table without pagination and hit css2pdf@cloudformatter service and get pdf and again set the table with pagination

Improvement suggestion: prepend BOM to CSV

Hi, I'm using this code and when I open the file with the default CSV handler, which like in several other machines happens to be Excel, I get garbage characters instead of my Unicode characters. Yet, the CSV is built correctly and I can see it if I save it before opening. This is a known issue for Excel, and the workaround is prepending the CSV with the BOM code, by changing your code at line #20 to data = '\uFEFF'; instead of just data='';. This way, any modern version of Excel (probably above 2003) opens the file correctly. Maybe you could consider integrating this change into your code.
Thank you!

Export ignores table filters

When exporting a CSV, the plugin ignores filters applied to table.

Plugin code contains the following:

if (tr.hasClass("ng-table-filters")) {
return;
}

...but this doesn't seem to have any effect. Would greatly appreciate a solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.