{"action":"created","issue":{"url":"https://api.github.com/repos/olifolkerd/tabulator/issues/1276","repository_url":"https://api.github.com/repos/olifolkerd/tabulator","labels_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/1276/labels{/name}","comments_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/1276/comments","events_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/1276/events","html_url":"https://github.com/olifolkerd/tabulator/issues/1276","id":341565965,"node_id":"MDU6SXNzdWUzNDE1NjU5NjU=","number":1276,"title":"Export to excel not working","user":{"login":"nwoow","id":3254550,"node_id":"MDQ6VXNlcjMyNTQ1NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/3254550?v=4","gravatar_id":"","url":"https://api.github.com/users/nwoow","html_url":"https://github.com/nwoow","followers_url":"https://api.github.com/users/nwoow/followers","following_url":"https://api.github.com/users/nwoow/following{/other_user}","gists_url":"https://api.github.com/users/nwoow/gists{/gist_id}","starred_url":"https://api.github.com/users/nwoow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwoow/subscriptions","organizations_url":"https://api.github.com/users/nwoow/orgs","repos_url":"https://api.github.com/users/nwoow/repos","events_url":"https://api.github.com/users/nwoow/events{/privacy}","received_events_url":"https://api.github.com/users/nwoow/received_events","type":"User","site_admin":false},"labels":[{"id":277350038,"node_id":"MDU6TGFiZWwyNzczNTAwMzg=","url":"https://api.github.com/repos/olifolkerd/tabulator/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"olifolkerd","id":6840524,"node_id":"MDQ6VXNlcjY4NDA1MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6840524?v=4","gravatar_id":"","url":"https://api.github.com/users/olifolkerd","html_url":"https://github.com/olifolkerd","followers_url":"https://api.github.com/users/olifolkerd/followers","following_url":"https://api.github.com/users/olifolkerd/following{/other_user}","gists_url":"https://api.github.com/users/olifolkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/olifolkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olifolkerd/subscriptions","organizations_url":"https://api.github.com/users/olifolkerd/orgs","repos_url":"https://api.github.com/users/olifolkerd/repos","events_url":"https://api.github.com/users/olifolkerd/events{/privacy}","received_events_url":"https://api.github.com/users/olifolkerd/received_events","type":"User","site_admin":false},"assignees":[{"login":"olifolkerd","id":6840524,"node_id":"MDQ6VXNlcjY4NDA1MjQ=","avatar_url":"https://avatars0.githubusercontent.com/u/6840524?v=4","gravatar_id":"","url":"https://api.github.com/users/olifolkerd","html_url":"https://github.com/olifolkerd","followers_url":"https://api.github.com/users/olifolkerd/followers","following_url":"https://api.github.com/users/olifolkerd/following{/other_user}","gists_url":"https://api.github.com/users/olifolkerd/gists{/gist_id}","starred_url":"https://api.github.com/users/olifolkerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olifolkerd/subscriptions","organizations_url":"https://api.github.com/users/olifolkerd/orgs","repos_url":"https://api.github.com/users/olifolkerd/repos","events_url":"https://api.github.com/users/olifolkerd/events{/privacy}","received_events_url":"https://api.github.com/users/olifolkerd/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-07-16T15:25:24Z","updated_at":"2018-07-22T16:53:00Z","closed_at":"2018-07-22T15:04:17Z","author_association":"NONE","body":"I am trying to load table data onclick method I am fetching data from api call each time I am calling a new data and displaying it to my table for that I am using this code:\r\n`        \r\n\r\n         var j = $( \"#example-table\" ).hasClass( \"tabulator\" ) \r\n          if (j) {\r\n            $(\"#example-table\").tabulator(\"destroy\");\r\n           \r\n   \r\n          }\r\n          $(\"#example-table\").tabulator({\r\n            layout:\"fitColumns\"});\r\n         \r\n          //set new columns\r\n          $(\"#example-table\").tabulator(\"setColumns\", res[\"column\"]);\r\n          \r\n          //set new data\r\n          $(\"#example-table\").tabulator(\"setData\", res[\"data\"]);\r\n\r\n\r\n          $(\"#download-xlsx\").click(function(){\r\n            $(\"#example-table\").tabulator(\"download\", \"xlsx\", \"data.xlsx\");\r\n          });\r\n      \r\n          $(\"#download-csv\").click(function(){\r\n            $(\"#example-table\").tabulator(\"download\", \"csv\", \"data.csv\");\r\n        });\r\n        \r\n        //trigger download of data.json file\r\n        $(\"#download-json\").click(function(){\r\n            $(\"#example-table\").tabulator(\"download\", \"json\", \"data.json\");\r\n        });`\r\n\r\nAnd in my html I am using this code:\r\n\r\n    \r\n            `  <button class =\"table-button\" id =\"download-xlsx\">Download XLSX</button>\r\n          <button class =\"table-button\" id =\"download-csv\">Download CSV</button>\r\n         <button class =\"table-button\" id =\"download-pdf\">Download PDF</button>\r\n          <button class =\"table-button\" id =\"download-json\">Download JSON</button>\r\n\r\n         <div id=\"example-table\" style=\"margin-bottom: 100px; margin-top: 30px;\" ></div>\r\n                 </div>`\r\n\r\nAs you can see I can show my data but the problem is when I am loading data onclick for example three times it download three files my question is how can I empty tabulator download data each time when I click. "},"comment":{"url":"https://api.github.com/repos/olifolkerd/tabulator/issues/comments/406881058","html_url":"https://github.com/olifolkerd/tabulator/issues/1276#issuecomment-406881058","issue_url":"https://api.github.com/repos/olifolkerd/tabulator/issues/1276","id":406881058,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjg4MTA1OA==","user":{"login":"nwoow","id":3254550,"node_id":"MDQ6VXNlcjMyNTQ1NTA=","avatar_url":"https://avatars2.githubusercontent.com/u/3254550?v=4","gravatar_id":"","url":"https://api.github.com/users/nwoow","html_url":"https://github.com/nwoow","followers_url":"https://api.github.com/users/nwoow/followers","following_url":"https://api.github.com/users/nwoow/following{/other_user}","gists_url":"https://api.github.com/users/nwoow/gists{/gist_id}","starred_url":"https://api.github.com/users/nwoow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nwoow/subscriptions","organizations_url":"https://api.github.com/users/nwoow/orgs","repos_url":"https://api.github.com/users/nwoow/repos","events_url":"https://api.github.com/users/nwoow/events{/privacy}","received_events_url":"https://api.github.com/users/nwoow/received_events","type":"User","site_admin":false},"created_at":"2018-07-22T16:53:00Z","updated_at":"2018-07-22T16:53:00Z","author_association":"NONE","body":"I am putting this code:\r\n\r\n`  $(\"#download-xlsx\").click(function(){\r\n    $(\"#example-table\").tabulator(\"download\", \"xlsx\", \"data.xlsx\");\r\n  });\r\n  \r\n  $(\"#download-csv\").click(function(){\r\n    $(\"#example-table\").tabulator(\"download\", \"csv\", \"data.csv\");\r\n  });\r\n  \r\n  //trigger download of data.json file\r\n  $(\"#download-json\").click(function(){\r\n    $(\"#example-table\").tabulator(\"download\", \"json\", \"data.json\");\r\n  });`\r\n\r\nOutside the function which is calling my ajax data but same thing is happening. In my case data can be loaded multiple times. I want to know how this can be reset each time a click event is happening."}}
{"actor":{"display_login":"nwoow"}}