问题
Is there any way to add a button to load data as and when required. I am aware of load data on demand option, This is not helping as I have more than 10 millions of data rows and it still takes time to load in spotfire. I need an option where in the visualization has to start the data loading when i click the button to start , where as "load data on demand" is an option to load at the source itself.
Under TEXT AREA we have an option to add "INSERT ACTION ITEM" which gives option to add button, can we use it and create an button called "Start" which will be used to load the data?
回答1:
Yes.
- Add the button as you described in your post
- Click Script > New
- Add this script and name it what ever you want, replacing 'Book1' with your table name
Note, you should still leave the data table as load on demand and then just use this to refresh the data, that way the initial load doesn't happen on start up
from System.Collections.Generic import List, Dictionary
from Spotfire.Dxp.Data import DataTable
Tbls = List[DataTable]()
Tbls.Add(Document.Data.Tables['Book1'])
Document.Data.Tables.Refresh(Tbls)
Also, if you are doing this in the web player, you can take advantage of paramertized load on demand features, or store the analysis in the web player cache and avoid this all together.
来源:https://stackoverflow.com/questions/44925626/spotfire-create-button-to-start-loading-data-instead-of-using-load-data-on-dem