Giter VIP home page Giter VIP logo

Comments (3)

robicch avatar robicch commented on July 25, 2024 1

Hi,
when you export something you want to save a file.
As far as I know, there is no way to do this from js, but you need to get the file from the server using a special header.

Here is the .jsp code of gimmeBack.jsp:

<%@ page import="net.sf.json.JSONArray, net.sf.json.JSONObject" %>
<%
String data = request.getParameter("prj");
JSONObject o=JSONObject.fromObject(data);
String filename = "project";
//use the name of the first task to set the name of the file
JSONArray tasks = o.getJSONArray("tasks");
JSONObject task = tasks.getJSONObject(0);
filename = task.getString("name");

response.resetBuffer();
response.setContentType("application/json");
String filenameEncoded = filename + ".json";
response.setHeader("content-disposition", "attachment; filename=" + filenameEncoded); //StringUtilities.normalize(rfs.getName())
out.print(data);
%>

from jquerygantt.

robicch avatar robicch commented on July 25, 2024

Twproject Gantt editor is a client side component. All server side parts
are not supplied because there are to may possible languages, php, java,
python, ruby etc.
The export button requires to create e response with a header for
downloading the project in a .json file: two lines of code :-)

2014-12-29 19:31 GMT+01:00 client4 [email protected]:

The Export button linkes to gimmeBack.jsp, however gimmeBack.jsp is not
included in the Github repository. I'm not sure if this is intentional or
not, but it does make the export button not useful.


Reply to this email directly or view it on GitHub
#28.

*Ing. Roberto Bicchierai - *Development Team Director
[email protected] blog: roberto.open-lab.com

open lab s.r.l.
via venezia 18b 50121 firenze italia
Tel: +39 055 5522779

See:

Twproject http://twproject.com/ open-lab.com http://open-lab.com

from jquerygantt.

Edisson avatar Edisson commented on July 25, 2024

Hi! I'm new in web (js) programming.
I embed your wonderful component in our Web (C#) project but can't understand how does the export have to work? please could you give me an advice?

from jquerygantt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.