workspace: script fetch+widgetBuild for selected node

This commit is contained in:
p 2026-08-12 16:45:03 +08:00
parent 10e6407419
commit f106d330a4

View File

@ -59,13 +59,9 @@ async with DBPools().sqlorContext(dbname) as sor:
"binds": [{
"wid": "self",
"event": "selected",
"actiontype": "urlwidget",
"target": "ws_files",
"options": {
"url": files_url + "?id=",
"params": {},
"event_params": ["id"]
}
"actiontype": "script",
"target": "self",
"script": f"var nid=this.selected_node.user_data.id;var fp=bricks.getWidgetById('ws_files',bricks.app);if(fp)fetch('{files_url}?id='+encodeURIComponent(nid)).then(function(r){{return r.json()}}).then(function(d){{fp.dom_element.innerHTML='';bricks.widgetBuild(d,fp);}});"
}]
}]
},