本帖最後由 epcsub 於 2026-8-22 23:44 編輯
- ## picklistgv: enhance
- ### current behavior
- - base/forms/picklistgv.py
- - it creates a floating picklist
- - user in a `gridview` -> F1 trigger at specific `trigger field` (a different field triggers a different picklist) -> collect `picklist items` -> create the picklist form -> user select an item -> feed a `specific value` to the original `gridview`
- - trigger field / picklist items / where to feed all controlled by `picklistgv.yaml`
- - build2.$trigger_field.0 = sql to collect picklist items
- - build2.$trigger_field.1.column = the picklist presented in how many columns; how-many atomic items per row
- - build2.$trigger_field.1.width = the picklist window width
- - build2.$trigger_field.1.list = how an atomic element is composed in picklist
- - build2.$trigger_field.1.feed = how the picked item should be feed
- ```yaml
- // sample picklistgv.yaml
- build2:
- cod:
- - select cod,des from accod order by cod
- - column: 3
- width: 550
- list: [cod, des]
- feed: [cod, des]
- ```
- ### enhance
- - issue: it happens often the collected picklist items are overwhelmingly large
- - extend picklistgv to support `multi-step` selection
- - collect `group` / `category` names -> user pick a `group`/`category` -> collect items of that `group`/`category` -> user pick `item` -> feed
- - `build2.$trigger_field` allows an arbitrary no. of collecting sql's, `build2.$trigger_field.0`, `build2.$trigger_field.1`, etc
- - look for the meta in `build2.$trigger_field.-1`
- ```yaml
- build2:
- cod:
- - select distinct grp from accod order by grp
- - select cod,des from accod where grp='{grp}' order by cod
- - column: 3
- width: 550
- list: [cod, des]
- feed: [cod, des]
- ```
- ### note
- - if you need an additional module, do not install, ask, I will plug it for you
複製代碼 |