Sunny Singh
Sunny Singh

Reputation: 1

Python Tabulator how can I have a TickCross column that only appears when another Column doesn't have a specific value

I have a Tabulator that has a tickCross column, plus "Location", "Building", "Added", "postcode", "Amount"

I want to only show the tickCross if another field "location" on the same row doesn't have the value 'london'. I already have filters but want to show the London sites regardless but prevent users from using the tickCross to select the row and do additional processing afterwards

How can I do this?

# Formatting individual columns in table
self.tab_editors = {
        "Selected": {
            "type": "tickCross",
            "indeterminateValue": None
        },
}

# Format
self._formatters = {
  "float": NumberFormatter(format="0.00000"),
  "Selected": BooleanFormatter(),
}

self.df_wid = pn.widgets.Tabulator(
    self.df_tbl_sample,
    formatters=self._formatters,
    editors=self.tab_editors,
    header_filters=self.my_filters,
    width=800,
)

I am assuming I need to update the editor so that the tickCross is visible under these conditions but not sure if this is possible or how to go about it

Upvotes: 0

Views: 23

Answers (0)

Related Questions