Datagrid action submits form

Hi!

I have a form containing among other things a (new) data grid.

Clicking any action in the datagrid submits the form.
(Even with no workflows defined on the datagrid.)

Am I missing something, or is this a bug?

The problem is solved if i move the datagrid outside the form, but for my layout that means also moving the submit button outside the form (making validation more complicated).

If anyone else has this problem, I finally figured it out:

The button used in an action column doesn’t have a defined type, so when the datagrid is inside a form, it automatically becomes a submit button…

You can fix this by forking the component and setting the type explicitly to button.
Inside ActionCellRenderer.vue, insert a new line so the button definition is:

<button
type=“button”
@click.stop=“onButtonClicked”
etc etc…

1 Like

Beautiful! Thanks for taking the time to share your solution on here, Andreas. Really appreciate it :slight_smile: