EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: raghav94 on July 02, 2017, 02:17:27 AM



Title: Create text file on local machine after getting data from TreeGrid
Post by: raghav94 on July 02, 2017, 02:17:27 AM
Hi,

I have created a TreeGrid.
I have the data from checked nodes.
I want to write this data in a text file and save it on my local machine.
Is it possible?


Title: Re: Create text file on local machine after getting data from TreeGrid
Post by: stworthy on July 02, 2017, 05:24:34 PM
The code below shows how to provide a download link. For more information please look at the Blog or File api.
Code:
var blob = new Blob(['content'], {type: 'text/plain'});
var a = $('<a>download it</a>').appendTo('body');
a.attr('href', URL.createObjectURL(blob));