[英]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.