Save datatable to local client disk file.

Does webix provide resources to save datatable to local disk file. (json, txt, csv etc) ?

Comments

  • edited November 20

    Hello @OsmarMartinelli,
    You can use export method:
    https://snippet.webix.com/95b1u2q7
    Or serialize the data to JSON and send it to the server for further processing.

  • Thank you. Export method work fine. However, after save the files to local disk, I also need to use the "Load" to read theese saved files into datatable on user demand. Before that I want to offer to the user a dialog file, similar the one offered by export webixtoCSV. I am studing the "uploader" with autosend=false. Unfortunatelly, after choose the file name, I had no sucess in extract the file name nor file extension from the uploader obj. $$("upl1").name , $$("upl1").extension. Can you provide some snippet?

  • Hello,
    Uploader with autosend:false allows to process the file (blob) on the client. After file is received to the client-side, uploader keeps it in the inner storage with the specific data, including the name/extension.
    To get the file after loading and import its data, you can add extra logic for your onBeforeFileAdd handler and create an instance of a FileReader object and use readAsText() method. After that, you can parse data into the datatable.
    Please try this snippet:
    https://snippet.webix.com/imv4qdyj

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!