Skip to content

Data Exporting - #703

Merged
tabalinas merged 7 commits into
tabalinas:masterfrom
richraid21:data-export
Apr 9, 2017
Merged

tabalinas merged 7 commits into
tabalinas:masterfrom
richraid21:data-export

Conversation

@richraid21

@richraid21 richraid21 commented Mar 28, 2017 •

Copy link
Copy Markdown
Contributor

Currently only supports CSV. This feature has been mentioned in #59, #388 and #568

Excerpt from the README (All properties are optional; the utility has it's own set of defaults) :

var csv = $("#grid").jsGrid("exportData", {
    type: "csv", //Only CSV supported
    subset: "all" | "visible", //Visible will only output the currently displayed page
    delimiter: "|", //If using csv, the character to seperate fields
    includeHeaders: true, //Include header row in output
    encapsulate: true, //Surround each field with qoutation marks; needed for some systems
    newline: "\r\n", //Newline character to use
    
    //Takes each item and returns true if it should be included in output.
    //Executed only on the records within the given subset above.
    filter: function(item){return true},
    
    //Transformations are a way to modify the display value of the output.
    //Provide a key of the field name, and a function that takes the current value.
    transformations: {
        "Married": function(value){
            if (value === true)
                return "Yes"
            if (value !== false)
                return "No"
        }
    }
});

The feature may need some tweaking, but I thought this was a good baseline.

Comment thread README.md
if (value === true)
return "Yes"
if (value !== false)
return "No"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (value !== false)
return "No"
wtf?
xD
realy o_O ???

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote the README when I was tired, sorry.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, guys, welcome from Ukraine :)

@tabalinas
tabalinas merged commit 0010c3b into tabalinas:master Apr 9, 2017
@tabalinas

Copy link
Copy Markdown
Owner

Thank you very much for the PR!

@Komap

Komap commented Apr 10, 2017

Copy link
Copy Markdown

NP :) thank you too

@arirangz

Copy link
Copy Markdown

That's a great feature!

When do you plan to release it in the dist?

Thanks

@ghost

ghost commented Jul 24, 2017

Copy link
Copy Markdown

I just wonder how can i get the last version that contain the 'exportData' feature

@Wardrop

Wardrop commented Sep 6, 2017 •

Copy link
Copy Markdown

A new release seems overdue to include such new features as this.

@klingamdinne

Copy link
Copy Markdown

Can i have a sample code how we can use exportData feature?

@Spucki

Spucki commented Sep 14, 2019

Copy link
Copy Markdown

How can I use the export function? Can someone please give me an example code?

@assadnazar

Copy link
Copy Markdown

Dev Team, any update?

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

Successfully merging this pull request may close these issues.

9 participants