Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kid1194/frappe-better-select-control
A small plugin for Frappe that adds the support of option groups to the select control.
https://github.com/kid1194/frappe-better-select-control
Last synced: 4 months ago
JSON representation
A small plugin for Frappe that adds the support of option groups to the select control.
- Host: GitHub
- URL: https://github.com/kid1194/frappe-better-select-control
- Owner: kid1194
- License: mit
- Created: 2022-07-31T15:06:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-14T16:05:41.000Z (over 1 year ago)
- Last Synced: 2024-05-15T18:14:08.940Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 10
- Watchers: 4
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-frappe - Select Control extended - Plugin that adds the support of options group to the select control. (Uncategorized / Uncategorized)
README
# Frappe Better Select Control
A small plugin for Frappe that adds the support of option groups to the select control.
---
### Table of Contents
- [Requirements](#requirements)
- [Setup](#setup)
- [Install](#install)
- [Update](#update)
- [Uninstall](#uninstall)
- [Usage](#usage)
- [Examples](#examples)
- [Single Option Group](#single-option-group)
- [Multiple Option Group](#multiple-option-groups)
- [Normal Options After Option Group](#normal-options-after-option-group)
- [Empty Option Group Label](#empty-option-group-label)
- [Placeholder Option](#placeholder-option)
- [Issues](#issues)
- [License](#license)---
### Requirements
- Frappe >= v13.0.0
---
### Setup
⚠️ *Important* ⚠️
*Do not forget to replace [sitename] with the name of your site in all commands.*
#### Install
1. Go to bench directory```
cd ~/frappe-bench
```2. Get plugin from Github
*(Required only once)*
```
bench get-app https://github.com/kid1194/frappe-better-select-control
```3. Build plugin
*(Required only once)*
```
bench build --app frappe_better_select_control
```4. Install plugin on a specific site
```
bench --site [sitename] install-app frappe_better_select_control
```5. Check the [usage](#usage) & [examples](#examples) below
#### Update
1. Go to app directory```
cd ~/frappe-bench/apps/frappe_better_select_control
```2. Get updates from Github
```
git pull
```3. Go to bench directory
```
cd ~/frappe-bench
```4. Build plugin
```
bench build --app frappe_better_select_control
```5. Update a specific site
```
bench --site [sitename] migrate
```6. (Optional) Restart bench
```
bench restart
```#### Uninstall
1. Go to bench directory```
cd ~/frappe-bench
```2. Uninstall plugin from a specific site
```
bench --site [sitename] uninstall-app frappe_better_select_control
```3. Remove plugin from bench
```
bench remove-app frappe_better_select_control
```4. (Optional) Restart bench
```
bench restart
```---
### Usage
1. Go to Customization > Customize Form
2. Enter the form type/name (ex: 'User')
3. Scroll down to the form fields area and edit the select fields you want
4. In the *options* property of the fields, add a hashtag (*#*) before the option text to make it a group label
5. To close a group just add a single hashtag (*#*) in a new line
6. Add an exclamation mark *!* before a hashtag (*#*) at the beginning of the option text to stop it from being used as a group label⚠️ **Important** ⚠️
You can't modify the original fields of a doctype, so create a new field or clone and modify the entire doctype.
---
### Examples
#### Single Option Group
- Options:
```
One
Two
#Three
Four
Five
```
- Result HTML:
```
One
TwoFour
Five```
#### Multiple Option Groups
- Options:
```
#One
Two
Three
#Four
Five
Six
```
- Result HTML:
```Two
ThreeFive
Six```
#### Normal Options After Option Group
- Options:```
One
Two
#Three
Four
Five
#
Six
```
- Result HTML:
```
One
TwoFour
FiveSix
```#### Empty Option Group Label
- Options:```
One
Two
#
Three
Four
Five
#
Six
```
- Result HTML:
```
One
TwoThree
Four
FiveSix
```#### Placeholder Option
- Options:```
$Select..
One
Two
#Three
Four
Five
#
Six
```
- Result HTML:
```
Select...
One
TwoFour
FiveSix
```---
### Issues
If you find bug in the plugin, please create a [bug report](https://github.com/kid1194/frappe-better-select-control/issues/new?assignees=kid1194&labels=bug&template=bug_report.md&title=%5BBUG%5D) and let us know about it.---
### License
MIT