Skip to content

Commit 4aed540

Browse files
committed
Make CallbackDispatcher an instance attribute
1 parent ae5f01e commit 4aed540

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ipydatagrid/datagrid.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,11 @@ class DataGrid(DOMWidget):
251251
editable = Bool(False).tag(sync=True)
252252
column_widths = Dict({}).tag(sync=True)
253253

254-
255-
_cell_change_handlers = CallbackDispatcher()
256-
_cell_click_handlers = CallbackDispatcher()
257-
258254
def __init__(self, dataframe, **kwargs):
259255
self.data = dataframe
260256
super(DataGrid, self).__init__(**kwargs)
257+
self._cell_click_handlers = CallbackDispatcher()
258+
self._cell_change_handlers = CallbackDispatcher()
261259
self.on_msg(self.__handle_custom_msg)
262260

263261
def __handle_custom_msg(self, _, content, buffers):

0 commit comments

Comments
 (0)