mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Add selection widget
This commit is contained in:
parent
c9a44b86cb
commit
1b6062beee
2
IPython/html/widgets/selection/model.js
Normal file
2
IPython/html/widgets/selection/model.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
var SelectionWidgetModel = IPython.WidgetModel.extend({});
|
||||||
|
IPython.notebook.widget_manager.register_widget_model('SelectionWidgetModel', SelectionWidgetModel);
|
15
IPython/html/widgets/selection/widget.py
Normal file
15
IPython/html/widgets/selection/widget.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from ..widget import Widget
|
||||||
|
from IPython.utils.traitlets import Unicode, List, Bool
|
||||||
|
from IPython.utils.javascript import display_all_js
|
||||||
|
|
||||||
|
class SelectionWidget(Widget):
|
||||||
|
target_name = Unicode('SelectionWidgetModel')
|
||||||
|
default_view_name = Unicode('DropdownView')
|
||||||
|
_keys = ['value', 'values', 'disabled']
|
||||||
|
|
||||||
|
value = Unicode()
|
||||||
|
values = List() # List of values the user can select
|
||||||
|
disabled = Bool(False) # Enable or disable user changes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user