workspace: script fetch+widgetBuild for selected node
This commit is contained in:
parent
10e6407419
commit
f106d330a4
@ -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);}});"
|
||||
}]
|
||||
}]
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user