more G-Labs products

Author Topic: Widget v2 save data to locale file  (Read 863 times)

September 10, 2016, 09:41:52 AM
Read 863 times

wolfgang928

  • *
  • Information
  • Newbie
  • Posts: 10
Hello all,

i'm just playing with download a widget side filtered list content  to a locale log file from inside widget.

Due to missing js libraries like FileSaver.js or others i found the adaption of the maintenance log download function

 $('#btn_configuresystem_downloadtday').bind('click', function () {
                window.open('/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/0');
            });

which is using a
(request.Context.Data as HttpListenerContext).Response.AddHeader("Content-Disposition", "attachment;filename=homegenie_log_" + migCommand.GetOption(1) + ".csv");
request.ResponseData = csvlog;

Is there any other way to make this locale inside widget, because all my data are inside widget yet and not on the server side due to the filtering feature.
Thanks for a hint!

Wolfgang

November 13, 2016, 11:31:48 PM
Reply #1

HGexperimenter

  • **
  • Information
  • Jr. Member
  • Posts: 42
Just read - helped me with some /API calls I was working on (Program.Stores).
Thanks!

November 14, 2016, 06:23:52 PM
Reply #2

raptorjr

  • ***
  • Information
  • Full Member
  • Posts: 78
Hello all,

i'm just playing with download a widget side filtered list content  to a locale log file from inside widget.

Due to missing js libraries like FileSaver.js or others i found the adaption of the maintenance log download function

 $('#btn_configuresystem_downloadtday').bind('click', function () {
                window.open('/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/0');
            });

which is using a
(request.Context.Data as HttpListenerContext).Response.AddHeader("Content-Disposition", "attachment;filename=homegenie_log_" + migCommand.GetOption(1) + ".csv");
request.ResponseData = csvlog;

Is there any other way to make this locale inside widget, because all my data are inside widget yet and not on the server side due to the filtering feature.
Thanks for a hint!

Wolfgang

This sounds cool. Is the code available?