Skip to content

Data Exporting#703

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

Data Exporting#703
tabalinas merged 7 commits intotabalinas:masterfrom
richraid21:data-export

Conversation

@richraid21
Copy link
Copy Markdown
Contributor

@richraid21 richraid21 commented Mar 28, 2017

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.

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
Copy link
Copy Markdown

Komap commented Apr 10, 2017

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
Copy link
Copy Markdown

ghost commented Jul 24, 2017

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

@Wardrop
Copy link
Copy Markdown

Wardrop commented Sep 6, 2017

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
Copy link
Copy Markdown

Spucki commented Sep 14, 2019

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