how to download file in JsTree

720 views
Skip to first unread message

Muhammad galih saputra

unread,
May 22, 2014, 3:39:17 AM5/22/14
to jst...@googlegroups.com

Ivan Bozhanov

unread,
May 22, 2014, 6:05:41 AM5/22/14
to jst...@googlegroups.com
Sorry but I have no idea what you mean ... serving files is something you do from the server side, jstree has nothing to do with this.
If you want to trigger a download, when a node is clicked for example, you can use the events jstree provides:

$('#tree').on('select_node.jstree', function (e, data) {
  data.node; // this is the selected node
  window.open('//some.tld/download?id=' + data.node.id); // this is just an example, but it is up to you to build the server script that will serve whatever you want
});

Best regards,
Ivan

22 май 2014, четвъртък, 10:39:17 UTC+3, Muhammad galih saputra написа:

Reply all
Reply to author
Forward
0 new messages