File tree Expand file tree Collapse file tree 5 files changed +17
-5
lines changed
Expand file tree Collapse file tree 5 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 44 hooks :
55 - id : check-yaml
66 - id : end-of-file-fixer
7+ exclude : " .*/assets/tabulator-tables/.*"
78 - id : trailing-whitespace
9+ exclude : " .*/assets/tabulator-tables/.*"
810 - repo : https://github.com/psf/black
911 rev : 24.8.0 # Replace by any tag/version: https://github.com/psf/black/tags
1012 hooks :
Original file line number Diff line number Diff line change @@ -394,7 +394,7 @@ This is most useful if you have multiple Tabulator components and don't want to
394394The default ` default_options ` are:
395395
396396``` python
397- Tabulator.default_options = {" layout" : " fitColumns" , " selectable " : False }
397+ Tabulator.default_options = {" layout" : " fitColumns" }
398398```
399399* (as well as all the JS Tabulator default options)*
400400
Original file line number Diff line number Diff line change 2222 _ignore_resize_observer_error ,
2323 _inject_theme ,
2424 _merge ,
25+ _normalizeOptions ,
2526 _options_property ,
2627 _spacing_property ,
2728 _to_module ,
@@ -133,6 +134,7 @@ def _initialize(self):
133134 logger .debug (f"Options: { self .options } " )
134135
135136 options = _camelKeys (self ._options ) | _camelKeys (self .options )
137+ options = _normalizeOptions (options )
136138 options ["columns" ] = [_camelKeys (defn ) for defn in options ["columns" ]]
137139 options ["columnDefaults" ] = _camelKeys (options ["columnDefaults" ])
138140 if in_designer and type (self ) is Tabulator :
@@ -154,10 +156,9 @@ def _initialize(self):
154156 # if we're using the rowSelection make sure things are selectable
155157 if (
156158 any (col .get ("formatter" ) == "rowSelection" for col in options ["columns" ])
157- and options .get ("selectable" ) is None
158- and Tabulator .default_options .get ("selectable" ) is False
159+ and options .get ("selectableRows" ) is None
159160 ):
160- options ["selectable " ] = "highlight"
161+ options ["selectableRows " ] = "highlight"
161162
162163 t = _Tabulator (self ._dom_node , options )
163164 t .anvil_form = self
Original file line number Diff line number Diff line change 4949 "Sort" ,
5050}
5151
52- _default_table_options = {"layout" : "fitColumns" , "selectable" : False }
52+ _default_table_options = {"layout" : "fitColumns" }
5353
5454
5555_default_theme = "bootstrap3"
Original file line number Diff line number Diff line change @@ -25,6 +25,15 @@ def _camelKeys(d):
2525 return {_toCamel (key ): val for key , val in d .items ()}
2626
2727
28+ def _normalizeOptions (options ):
29+ # selectable was removed in tabulator 6 in favour of selectableRows
30+ # but we still support it for backwards compatibility
31+ if "selectable" in options :
32+ options ["selectableRows" ] = options ["selectable" ]
33+ del options ["selectable" ]
34+ return options
35+
36+
2837def _merge (default , properties , ** overrides ):
2938 merged = overrides
3039 for key , val in default .items ():
You can’t perform that action at this time.
0 commit comments