{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " \n", " \n", " \n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Radio\n", "\n", "\n", "Radio [component](00_components.ipynb) creation in Epyk will be using the function **radio** from the ui property.\n", "\n", "the ui entry point will give you access to all the registered components.\n", "Different flavour of buttons are available in the framework.\n", "\n", "## Basic radio" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "\n", "rptObj.ui.fields.radio(True, label=\"Check 1\", group_name=\"group1\")\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "\n", "rptObj.ui.fields.radio(True, label=\"Check 1\", group_name=\"group1\")\n", "c2 = rptObj.ui.fields.radio(True, label=\"Check 2\", group_name=\"group1\")\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "Check\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "\n", "rptObj.ui.icons.tick(False, \"Check\")\n", "\n", "rptObj.outs.jupyter()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "" ], "text/plain": [ "" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from epyk.core.Page import Report\n", "\n", "rptObj = Report()\n", "\n", "c5 = rptObj.ui.lists.radios([\n", " {\"value\": True, 'label': 'Python'},\n", " {\"value\": False, 'label': 'Javascript'},\n", "])\n", "\n", "rptObj.outs.jupyter()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.2" } }, "nbformat": 4, "nbformat_minor": 4 }