When the user deletes a row from a form grid, can I define an event handler to intercept

Confluence User - 07 Apr, 2017

I have a requirement where certain rows in a form grid, can be modified by the user, but cannot be deleted. while other rows can be deleted. This is determined by a hidden field (a flag) in each row.

I cannot find anywhere in the configuration for the Form Grid where I can define this. There is only options to disable add feature and define the delete confirmation message.

What I want to achieve is if the user clicks on the X button to delete the row, the application will check the flag field of the row(this can be achieved by Bean Shell, I suppose) and display the warning message accordingly.

OR alternatively is there any way to remove X (delete row) button for certain rows programmatically? Meaning those rows that cannot be deleted, should have the X button removed. Those rows that can be deleted will have the X button remain.

Thanks,

 

 

forms

3


07 Apr, 2017
confluenceUser
confluenceUser

Hi, you should be able to use some custom JavaScript to do the necessary. Inspect the elements in your browser and you can selectively hide it using JS code like $("a.grid-action-delete").hide()

Alternatively, why not have 2 different form grids instead? One with non-removable items and another with removable ones.

07 Apr, 2017
confluenceUser
confluenceUser

Hi Herman, I second Ander's idea on having 2 grids, it will be clear cut for the users to know which they can and cannot edit. Cheers Hugo

17 May, 2017
confluenceUser
confluenceUser

Hi Hugo, If we have 2 grids, it will perform "query" to database twice, right? Based on our experience, it will have problem when the database/table size is big (e.g. : table records more than hundred thousands row).

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print