MCPcopy Index your code
hub / github.com/plotly/dash / triggered_id

Method triggered_id

dash/_callback_context.py:122–138  ·  view source on GitHub ↗

Returns the component id (str or dict) of the Input component that triggered the callback. Note - use `triggered_prop_ids` if you need both the component id and the prop that triggered the callback or if multiple Inputs triggered the callback. Example usage:

(self)

Source from the content-addressed store, hash-verified

120 @property
121 @has_context
122 def triggered_id(self):
123 """
124 Returns the component id (str or dict) of the Input component that triggered the callback.
125
126 Note - use `triggered_prop_ids` if you need both the component id and the prop that triggered the callback or if
127 multiple Inputs triggered the callback.
128
129 Example usage:
130 `if "btn-1" == ctx.triggered_id:
131 do_something()`
132
133 """
134 component_id = None
135 if self.triggered:
136 prop_id = self.triggered_prop_ids.first()
137 component_id = self.triggered_prop_ids[prop_id]
138 return component_id
139
140 @property
141 @has_context

Callers

nothing calls this directly

Calls 1

firstMethod · 0.80

Tested by

no test coverage detected