fix: add optional target
attr for GridAction
This commit is contained in:
parent
a405b19217
commit
59fe324872
|
@ -2280,6 +2280,10 @@ class GridAction:
|
|||
|
||||
See also :meth:`get_url()`.
|
||||
|
||||
.. attribute:: target
|
||||
|
||||
Optional ``target`` attribute for the ``<a>`` tag.
|
||||
|
||||
.. attribute:: icon
|
||||
|
||||
Name of icon to be shown for the action link.
|
||||
|
@ -2297,6 +2301,7 @@ class GridAction:
|
|||
key,
|
||||
label=None,
|
||||
url=None,
|
||||
target=None,
|
||||
icon=None,
|
||||
link_class=None,
|
||||
):
|
||||
|
@ -2305,6 +2310,7 @@ class GridAction:
|
|||
self.app = self.config.get_app()
|
||||
self.key = key
|
||||
self.url = url
|
||||
self.target = target
|
||||
self.label = label or self.app.make_title(key)
|
||||
self.icon = icon or key
|
||||
self.link_class = link_class or ''
|
||||
|
|
|
@ -180,6 +180,9 @@
|
|||
% for action in grid.actions:
|
||||
<a v-if="props.row._action_url_${action.key}"
|
||||
:href="props.row._action_url_${action.key}"
|
||||
% if action.target:
|
||||
target="${action.target}"
|
||||
% endif
|
||||
class="${action.link_class}">
|
||||
${action.render_icon_and_label()}
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue