diff --git a/xls2ddl/tmpls.py b/xls2ddl/tmpls.py index 70f95d7..099792d 100644 --- a/xls2ddl/tmpls.py +++ b/xls2ddl/tmpls.py @@ -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":{