Labels

Clear marking (unmark)

1
2
3
4
5
6
7
from Spotfire.Dxp.Data import DataManager 
from Spotfire.Dxp.Data import IndexSet 
from Spotfire.Dxp.Data import RowSelection 

marking=Application.GetService[DataManager]().Markings[markingName]
selectRows = IndexSet(dataTable.RowCount, False)
marking.SetSelection(RowSelection(selectRows),dataTable)

Input:
markingName (String): The name of the marking profile to clear.
dataTable (Data Table): The data table that currently has the marking applied.

6 comments:

  1. Hi, Is there a way to clear markings when the filter settings are changed? Thanks!!!

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Hi,

    I am wondering if there is a way to store the active marking for a data table in a variable, then reapply this marking after a data reload has been performed?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. from Spotfire.Dxp.Application.Visuals import VisualContent
      from Spotfire.Dxp.Data import IndexSet
      from Spotfire.Dxp.Data import RowSelection

      vc = vis.As[VisualContent]()
      dataTable = vc.Data.DataTableReference
      marking = vc.Data.MarkingReference
      remark = Document.ActiveMarkingSelectionReference.GetSelection(Document.ActiveDataTableReference).AsIndexSet()

      #Refresh PHAT Data Table
      if table.IsRefreshable and table.NeedsRefresh:
      table.Refresh()
      #Remark correct rows
      marking.SetSelection(RowSelection(remark),dataTable)


      Script Parameters:
      vis as Visualization
      table as Data Table

      Delete