Skip to content

Commit

Permalink
#7444 unified easyform docs for scala groovy and python, added value …
Browse files Browse the repository at this point in the history
…parameter for python DatePicker widget (#7678)
  • Loading branch information
lmitusinski authored and LeeTZ committed Jul 11, 2018
1 parent c270cef commit 343f503
Show file tree
Hide file tree
Showing 4 changed files with 365 additions and 115 deletions.
1 change: 1 addition & 0 deletions beakerx/beakerx/easyform/easyform.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def addList(self, *args, **kwargs):

def addDatePicker(self, *args, **kwargs):
data_picker = DatePicker(description=self.getDescription(args, kwargs))
data_picker.value = getValue(kwargs, 'value', '')
self.children += (data_picker,)
self.components[data_picker.description] = data_picker
return data_picker
Expand Down
72 changes: 69 additions & 3 deletions doc/groovy/EasyForm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
]
},
"outputs": [],
"source": [
"\"Good morning \" + f[\"first\"] + \" \" + f[\"last\"]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"f['last'].reverse() + '...' + f['first']"
]
Expand Down Expand Up @@ -183,7 +192,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Dates are"
"### Dates"
]
},
{
Expand All @@ -203,7 +212,7 @@
"metadata": {},
"outputs": [],
"source": [
"gdp['Date'].getClass()"
"gdp['Date']"
]
},
{
Expand All @@ -221,10 +230,47 @@
"source": [
"easyForm = new EasyForm(\"Field Types\")\n",
"// Setup date via String (format is yyyyMMdd) also works\n",
"easyForm.addDatePicker(\"Date\").setDate(new Date())\n",
"easyForm.addDatePicker(\"Date\").setDate(\"20180102\")\n",
"easyForm"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Default Values"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"h = new EasyForm(\"Default Values\")\n",
"h.addTextArea(\"Default Value\", value = \"Initial value\")\n",
"h.addCheckBox(\"Default Checked\", value = true)\n",
"h.addButton(\"Press\", tag = \"check\")\n",
"h"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"check"
]
},
"outputs": [],
"source": [
"result = [:]\n",
"h.keySet().each {\n",
" result[it] = h[it]\n",
"}\n",
"result"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -262,6 +308,13 @@
"source": [
"widgetForm['IntSlider']"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -283,6 +336,19 @@
"nbconverter_exporter": "",
"version": "2.4.3"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": false,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": false,
"toc_window_display": false
},
"widgets": {
"state": {
"90dc3e2a-7242-492c-905f-a7dc4ce972fa": {
Expand Down
Loading

0 comments on commit 343f503

Please sign in to comment.