simpleui icon indicating copy to clipboard operation
simpleui copied to clipboard

弹出层layer 中的select 类型的下拉选项列表能否支持动态获取呢

Open gangchzu opened this issue 1 year ago • 1 comments

你希望增加什么功能? 弹出层layer 中的select 类型的下拉选项列表能否支持动态获取呢,目前来看只能写死固定值,要想动态获取现在能支持吗?谢谢!

gangchzu avatar Jul 03 '24 14:07 gangchzu

可以自己重写get_actions 函数,找到那个action动作更新它的layer.

def get_actions(self, request): actions = super().get_actions(request) actions['test'][0].layer = { 'title': 'test', 'confirm_button': 'OK', 'cancel_button': 'Cancel', 'width': '50%', 'labelWidth': "80px", 'params': [ { 'type': 'select', 'key': 'site', 'label': 'Site', 'require': True, 'options': [{'key': i, 'label': i} for i in sites_ids_list(username)], }, ] }

Star-fly-Cheng avatar Jan 17 '25 06:01 Star-fly-Cheng