Skip to content

Commit

Permalink
Merge pull request #351 from maxfordham/fix-editgrid-init
Browse files Browse the repository at this point in the history
🐛 EditGrid: Pass kwargs to parent class
  • Loading branch information
ollyhensby authored Jan 6, 2025
2 parents fd944b4 + fc233c3 commit 92107ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/ipyautoui/custom/buttonbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ class CrudView(ty.TypedDict):
),
support=CrudOptions(
**dict(HELP_BUTTON_KWARGS)
| dict(layout=dict(display="None"))
| dict(
tooltip="help - click to show description of all buttons in the toolbar",
tooltip_clicked="hide help dialogue",
Expand Down Expand Up @@ -357,7 +356,7 @@ class CrudButtonBar(w.VBox):
fn_backward = tr.Callable(default_value=lambda: print("backward"))
fn_support = tr.Callable(default_value=lambda: print("support"))
fn_reload = tr.Callable(default_value=None, allow_none=True)
show_support = tr.Bool(default_value=False)
show_support = tr.Bool(default_value=True)

@tr.observe("show_support")
def _observe_show_support(self, change):
Expand Down
8 changes: 5 additions & 3 deletions src/ipyautoui/custom/editgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.16.1
# jupytext_version: 1.16.6
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
Expand Down Expand Up @@ -336,7 +336,9 @@ def __init__(
self._init_form()
self._init_row_controls()
self._init_controls()
super().__init__()
# NOTE: setting kwargs here and in _init_autogrid may cause unwanted behaviour
# PR: https://github.com/maxfordham/ipyautoui/pull/351
super().__init__(**kwargs)
self.warn_on_delete = warn_on_delete
# self.show_copy_dialogue = show_copy_dialogue
self.show_copy_dialogue = False
Expand Down Expand Up @@ -738,7 +740,7 @@ class TestDataFrame(RootModel):
),
)

editgrid._update_from_schema(TestDataFrame, value=[{"string": "Test"}] * 10)
editgrid.update_from_schema(TestDataFrame, value=[{"string": "Test"}] * 10)

if __name__ == "__main__":
from pydantic import RootModel
Expand Down

0 comments on commit 92107ee

Please sign in to comment.