pages:
- path: datalistfromquery-hierarchy-test-0510
blocks:
- type: query
resource: mysql.qa
sqlType: insert
sql: >
INSERT INTO products (code_group1, code_group2, code_group3, name)
values (:code1, :code2, :code3, :name)
reloadAfterSubmit: true
class: p-2
params:
- key: name
required: true
class: w-100 pb-2
- key: code1
required: true
datalistDropdown: true
dropdownSize: 10
datalistFromQuery:
type: query
resource: mysql.qa
sql: >
SELECT DISTINCT level1 AS value
FROM category
ORDER BY level1 ASC
- key: code2
datalistDropdown: true
dropdownSize: 10
hiddenIfNotOption: true
# disableIfNotOption: true
datalistFromQuery:
type: query
resource: mysql.qa
sql: >
SELECT DISTINCT level2 AS value
FROM category
WHERE level1 = :code1
ORDER BY level2 ASC
- key: code3
datalistDropdown: true
dropdownSize: 10
hiddenIfNotOption: true
# disableIfNotOption: true
datalistFromQuery:
type: query
resource: mysql.qa
sql: >
SELECT DISTINCT level3 AS value
FROM category
WHERE level1 = :code1
AND level2 = :code2
ORDER BY level3 ASC
param 순서대로 딜레이 실행됩니다.
params:
- key: item
label: 품목
datalistDelay: 300 # 딜레이 별도 설정
datalistDropdown: true
datalistFromQuery: ...