fix: -@ target -> window.location.assign, Input -> KeyinText
-@ is not a valid CSS selector, Bricks parses it as '#@' and fails. Switched all filter button binds to actiontype:script with window.location.assign(). Replaced nonexistent Input widget with KeyinText for search.
This commit is contained in:
parent
32000e8757
commit
cb53b9aeeb
@ -20,36 +20,32 @@
|
|||||||
"options": {"width": "100%", "cheight": 4, "gap": "6px", "alignItems": "center"},
|
"options": {"width": "100%", "cheight": 4, "gap": "6px", "alignItems": "center"},
|
||||||
"subwidgets": [
|
"subwidgets": [
|
||||||
{
|
{
|
||||||
"widgettype": "Input",
|
"widgettype": "KeyinText",
|
||||||
"id": "plaza_search_input",
|
"id": "plaza_search_input",
|
||||||
"options": {
|
"options": {
|
||||||
"cwidth": 40,
|
"cwidth": 40,
|
||||||
"cheight": 3,
|
"cheight": 3,
|
||||||
"placeholder": "搜索模型名称或描述...",
|
"name": "search",
|
||||||
"text": "{{active_search}}"
|
"css": "plaza-search-input"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widgettype": "Button",
|
"widgettype": "Button",
|
||||||
"id": "btn_search",
|
"id": "btn_search",
|
||||||
"options": {"label": "搜索", "css": "plaza-search-btn", "cwidth": 8, "cheight": 3},
|
"options": {"label": "搜索", "css": "plaza-search-btn", "cwidth": 8, "cheight": 3},
|
||||||
"binds": [
|
"binds": [{
|
||||||
{
|
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
||||||
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
"script": "var w=bricks.getWidgetById('plaza_search_input',bricks.app);var q=w?w.text:'';window.location.assign('{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&catelogid={{active_catelog}}&search='+encodeURIComponent(q));"
|
||||||
"script": "var inp=bricks.getWidgetById('plaza_search_input',bricks.app);var q=inp?inp.dom_element.querySelector('input').value:'';var u='{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&catelogid={{active_catelog}}&search='+encodeURIComponent(q);bricks.app.navigate_to(u);"
|
}]
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{% if active_search %}
|
{% if active_search %}
|
||||||
{
|
{
|
||||||
"widgettype": "Button",
|
"widgettype": "Button",
|
||||||
"options": {"label": "清除", "css": "plaza-clear-btn", "cwidth": 6, "cheight": 3},
|
"options": {"label": "清除", "css": "plaza-clear-btn", "cwidth": 6, "cheight": 3},
|
||||||
"binds": [
|
"binds": [{
|
||||||
{
|
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
||||||
"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "-@",
|
"script": "window.location.assign('{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&catelogid={{active_catelog}}');"
|
||||||
"options": {"url": "{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&catelogid={{active_catelog}}"}
|
}]
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{"widgettype": "Filler"}
|
{"widgettype": "Filler"}
|
||||||
@ -64,7 +60,6 @@
|
|||||||
{
|
{
|
||||||
"widgettype": "HBox",
|
"widgettype": "HBox",
|
||||||
"options": {"css": "plaza-catelog-bar", "width": "100%", "wrap": true, "gap": "4px", "padding": "4px 0"},
|
"options": {"css": "plaza-catelog-bar", "width": "100%", "wrap": true, "gap": "4px", "padding": "4px 0"},
|
||||||
"binds": [],
|
|
||||||
"subwidgets": [
|
"subwidgets": [
|
||||||
{
|
{
|
||||||
"widgettype": "Button",
|
"widgettype": "Button",
|
||||||
@ -75,8 +70,8 @@
|
|||||||
"cwidth": 8, "cheight": 2
|
"cwidth": 8, "cheight": 2
|
||||||
},
|
},
|
||||||
"binds": [{
|
"binds": [{
|
||||||
"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "-@",
|
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
||||||
"options": {"url": "{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&search={{active_search}}"}
|
"script": "window.location.assign('{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&search={{active_search}}');"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
{% for c in catelogs %}
|
{% for c in catelogs %}
|
||||||
@ -89,8 +84,8 @@
|
|||||||
"cwidth": 10, "cheight": 2
|
"cwidth": 10, "cheight": 2
|
||||||
},
|
},
|
||||||
"binds": [{
|
"binds": [{
|
||||||
"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "-@",
|
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
||||||
"options": {"url": "{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&catelogid={{c.id}}&search={{active_search}}"}
|
"script": "window.location.assign('{{entire_url('model_plaza.ui')}}?providerid={{active_provider}}&catelogid={{c.id}}&search={{active_search}}');"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -127,8 +122,8 @@
|
|||||||
"cwidth": 18
|
"cwidth": 18
|
||||||
},
|
},
|
||||||
"binds": [{
|
"binds": [{
|
||||||
"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "-@",
|
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
||||||
"options": {"url": "{{entire_url('model_plaza.ui')}}?catelogid={{active_catelog}}&search={{active_search}}"}
|
"script": "window.location.assign('{{entire_url('model_plaza.ui')}}?catelogid={{active_catelog}}&search={{active_search}}');"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
{% for p in providers %}
|
{% for p in providers %}
|
||||||
@ -141,8 +136,8 @@
|
|||||||
"cwidth": 18
|
"cwidth": 18
|
||||||
},
|
},
|
||||||
"binds": [{
|
"binds": [{
|
||||||
"wid": "self", "event": "click", "actiontype": "urlwidget", "target": "-@",
|
"wid": "self", "event": "click", "actiontype": "script", "target": "self",
|
||||||
"options": {"url": "{{entire_url('model_plaza.ui')}}?providerid={{p.providerid}}&catelogid={{active_catelog}}&search={{active_search}}"}
|
"script": "window.location.assign('{{entire_url('model_plaza.ui')}}?providerid={{p.providerid}}&catelogid={{active_catelog}}&search={{active_search}}');"
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user