How to save view model data into client PC

38 views
Skip to first unread message

Silan Liu

unread,
Jul 23, 2016, 10:16:39 AM7/23/16
to KnockoutJS
Hi,

I have an algorithm engine at server, which takes a long time (30 seconds) to process, and returns the computation result to the client browser. If user is not satisfied, he/she can change the parameters of the engine through an Ajex call, the engine will execute for another 30 seconds, then return a different result to the client. This can go for many iterations, until user is satisfied. Every time, when the algorithm engine finishes running, the sever doesn't have the result. It is transient in sever. It has already been returned to the client browser and stored there as the view model. 

Now user wants to save the result as a text file. Obviously, the most logical way is to save the data in the Knockout view model, which resides on the user's PC, into that PC. But I don't know how to do this.

If this cannot be done, then I will have to let user click a "download result" button, which causes the engine at the server to execute for another 30 seconds, produce the result, then download to the client. User will be annoyed because he/she will say "I have accepted this result, why did the engine run again?" Or I will be forced to save the result at the server into database, so that it can be downloaded to the client. Neither is ideal.

This is like a sales man knocks on your door and demonstrates a vacuum cleaner, and you like it very much and want to buy it, and the sales man tells you to drive 100 miles to their warehouse to buy another one.

Gunnar Liljas

unread,
Jul 23, 2016, 5:06:46 PM7/23/16
to knock...@googlegroups.com
I've created Excel files client side, from the view model, using this technique;


--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages