tableau / extensions-api

Extensions API sample code and developer docs.
http://tableau.github.io/extensions-api
MIT License
268 stars 251 forks source link

General question #159

Closed hanane-tableau closed 5 years ago

hanane-tableau commented 6 years ago

Hi,

I'm starting lately to use array extension API.

I find that this function is excellent and it solves a lot of problem however I have some questions:

Can we reload the extension with each filter change? (Add an event listener for the selection changed event on the dahsboad) Can we search a worksheet globally in the workbook?

Thank you

johnDance commented 6 years ago

Welcome to building extensions! It is great to have you.

To answer your questions:

  1. Reloading the extension is not normally desired because configurations that aren't saved in settings are lost. Normally you will want to listen to FilterChanged events, and then change your internal state as needed. You can call worksheet.addEventListener(FilterChanged, ...) to listen to filter changes.

  2. The short answer is no. You can only see worksheets on the dashboard. Currently, these are dashboard extensions, so they live in a dashboard, and only have access to the current dashboard environment. We are exploring other extension types that would be outside of a dashboard, but don't have anything formal to announce.

Welcome again! If I missed the crux of either of your questions, let me know. John

hanane-tableau commented 6 years ago

Hi john

Thank you very much, you have answered my questions. :+1:

hanane-tableau commented 6 years ago

I have other question:

Is there a possibility to run the extension before connecting to the database : Because , I have a dashboard whose data source is based on two parameters (start date and end date) and I would like to have as default date today (in the start and end date)

Thanks

Kovner commented 6 years ago

Nope, no way to control the fact that the db query happens before the loading of the Extension. That's something that's been requested but isn't on our short or medium term roadmap.

hanane-tableau commented 6 years ago

Thanks :+1:

hanane-tableau commented 6 years ago

Sorry again another question and thank you very much for your help

even when I allow the extension in tableau online, I still have the window to allow the extension when I open the dashboard is that't normal?

johnDance commented 6 years ago

It is normal, but the site administration (which sounds like it is you), can add extensions to a white list. In that white list, you can specify if the extension can access full data, and if there should be a user prompt. Go to the Settings > Extensions in the site settings, and look for "Enable specific Extensions". You specify the URL, and then pick from drop downs for "Full Data Access" and "User Prompts".

hanane-tableau commented 6 years ago

Thank you :+1:

hanane-tableau commented 6 years ago

Another question, and like always i really appreciate your help the script of my extension does not run directly, it is blocked by the browser (chrome) -The code of the extension is not yet host I test it locally. -I deactivated (Ensure your protection and that of your device against dangerous sites.) On the browser (always blocked) the link of the html page of my extension is like this : http://localhost:Port/recap_c/page.html what do I have to do image

Thanks

johnDance commented 6 years ago

Since online uses https, Chrome doesn't like you loading http, even from your localhost. The dialog that you show will allow you to override that setting for that page. The blue text (hidden by the popup in your case) is "Load unsafe scripts". Clicking that will allow the extension to load.

There is a discussion on stackoverflow about command line options you can give to Chrome to allow insecure content during development, but those settings seem to be in flux in recent versions of Chrome.