grid.js - export data from grid do csv, txt

48 Views Asked by At

Is any possible to add export data from grid.js to any format (CSV or TXT). Can someone help me with code that is simple for a PHP programmer to implement?

My simple demo on codepen: https://codepen.io/marcif/pen/KKEjgXE

I can't find any example online on how to do this

new gridjs.Grid({
    columns: ["Name", "Email", "Phone Number", "Gender"],
    sort: true,
    data: [
          ["Dirk", "[email protected]", "(646) 3432270", "Male"],
          ["Maryl", "[email protected]", "(980) 3335235", "Female"],
          ["Stefan", "[email protected]", "(180) 3533257", "Male"],
          ["Stephanie", "[email protected]", "(904) 5358792", "Female"],
          ["Emeline", "[email protected]", "(308) 6561908", "Female"],
          ["Gavra", "[email protected]", "(383) 4909639", "Female"],
          ["Roxi", "[email protected]", "(980) 3335235", "Male"],
          ["Jamey", "[email protected]", "(773) 5233571", "Male"],
          ["Maye", "[email protected]", "(895) 9997017", "Female"]
        ]
}).render(document.getElementById("table"));
0

There are 0 best solutions below