fix: use getWidgetById instead of this in tree script
This commit is contained in:
parent
61fb3f6485
commit
ebf7757dd2
@ -61,7 +61,7 @@ async with DBPools().sqlorContext(dbname) as sor:
|
||||
"event": "selected",
|
||||
"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);}});"
|
||||
"script": f"var tree=bricks.getWidgetById('ws_tree',bricks.app);var nid=tree.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