Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: GridFieldEditableColumns should not prevent "click to edit" on GridField rows #279

Open
robbieaverill opened this issue Jan 9, 2019 · 3 comments

Comments

@robbieaverill
Copy link
Contributor

Context: SilverStripe 4.3.0

When you add GridFieldEditableColumns to a GridField, the default behaviour is that it disables the "click to edit" functionality for that row. Instead, you either choose "Edit" from the more actions dropdown, or the standalone "Edit" button if you don't have any other actions.

This RFC is to discuss whether to re-enable the click handler for the row, so that clicking anywhere in the row it would take you to the edit form for that row as usual in a GridField. Exclusions would be when clicking on anything in the row that has its own click handling, e.g. the drag handle for reordering if you're using GridFieldOrderableRows, an editable form field, a GridField action such as "Edit" or "Delete" or an inline link in the text if you're using GridFieldDataColumns or something to add links into the row text.

cc @sachajudd

@ScopeyNZ
Copy link
Contributor

ScopeyNZ commented Jan 9, 2019

I think it should at least be an option. I believe the more common use case for this GridField component is to have a fairly substantial in-line form, but our use case (of just two tickboxes) means that not having the click handler feels weird.

@robbieaverill
Copy link
Contributor Author

Right, so it becomes a configurable option instead?

@seppzzz
Copy link

seppzzz commented Jan 6, 2021

GridFieldExtensions.js at Line 258 :

/**
 * GridFieldEditableColumns
 */

/* MINUS :  $('.ss-gridfield-editable .ss-gridfield-item').entwine({  */
/* PLUS : */  $('td').entwine({
			onclick: function(e) {
				// Prevent the default row click action when clicking a cell that contains a field
				if (this.find('.editable-column-field').length) {
					e.stopPropagation();
				}
			}
		});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants