feat: auto-generate InlineForm for data_filter fields
- When data_filter.fields exists, generate InlineForm with search inputs - Bind submit event to refresh Tabular - Each field uses uitype from data_filter definition
This commit is contained in:
parent
3c5552db14
commit
6b8bc8bee3
@ -2,7 +2,33 @@ data_browser_tmpl = """
|
||||
{
|
||||
"widgettype":"VBox",
|
||||
"options":{"cheight":40,"width":"100%"},
|
||||
"subwidgets":[{
|
||||
"subwidgets":[
|
||||
{% if data_filter and data_filter.fields %}
|
||||
{
|
||||
"widgettype":"InlineForm",
|
||||
"id":"{{tblname}}_search",
|
||||
"options":{
|
||||
"css":"card",
|
||||
"padding":"8px",
|
||||
"show_label":false,
|
||||
"submit_label":"搜索",
|
||||
"submit_css":"primary",
|
||||
"fields":[
|
||||
{% for f in data_filter.fields %}
|
||||
{"name":"{{f.field}}","uitype":"{{f.uitype}}","placeholder":"{{f.title}}","cwidth":15}{% if not loop.last %},{% endif %}
|
||||
{% endfor %}
|
||||
]
|
||||
},
|
||||
"binds":[{
|
||||
"wid":"self",
|
||||
"event":"submit",
|
||||
"actiontype":"method",
|
||||
"target":"{{tblname}}_tbl",
|
||||
"method":"render"
|
||||
}]
|
||||
},
|
||||
{% endif %}
|
||||
{
|
||||
"id":"{{tblname}}_tbl",
|
||||
"widgettype":"Tabular",
|
||||
"options":{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user