[英]Spotfire - How to add a reload button
如何添加按鈕,以及每當用戶單擊按鈕時,數據就會重新加載。
用戶還應該知道何時刷新數據。
您可以使用此python腳本,如此處所示 。
from System.Collections.Generic import List, Dictionary
from Spotfire.Dxp.Data import DataTable
from System.Collections import ArrayList
#Refreshing a single Data table:
dataTable.Refresh() // where dataTable is a script parameter of type DataTable
#Refreshing multiple tables:
#Note that more than one table can be added to the List object.
tables = ArrayList()
tables.Add(Document.Data.Tables["DataTable1"])
tables.Add(Document.Data.Tables["DataTable2"])
Document.Data.Tables.Refresh(tables)
#As such DataTableCollection.Refresh Method refreshes the given tables in dependency order.
#OR
Document.Data.Tables.RefreshAsync(tables)
#And DataTableCollection.RefreshAsync Method (IEnumerable< DataTable> ) refreshes the given tables in dependency order.
#Tables that have asynchronous refresh (i.e. Data On Demand and Data Functions) and tables that depend on them will be refreshed
#in later transactions.
# Another possible option:
Tbls = List[DataTable]()
Tbls.Add(Document.Data.Tables["DataTable1"])
Tbls.Add(Document.Data.Tables["DataTable2"])
for i in Tbls:
Document.Data.Tables.Refresh([i])
為了讓用戶知道何時刷新數據,只需使用當前日期/時間設置文檔屬性,然后在文本區域中顯示該文檔屬性。 運行上面的腳本時,日期/時間將更新。
另外,請查看位於此處的Python API頁面(適用於7.6,但也可以找到更新的7.12 API)。 盡管它的組織方式有些令人沮喪,但您可以體會到可以在腳本中調用的方法和類,以編程方式執行各種操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.