FIX clickable editable rows

(fixes #135)
This commit is contained in:
Jonathon Menz 2016-03-11 17:50:52 -08:00
parent 223627fef9
commit 126b1d543c
2 changed files with 9 additions and 3 deletions

View File

@ -218,6 +218,9 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
));
}
// Add CSS class for interactive fields
if (!($field->isReadOnly() || $field instanceof LiteralField)) $field->addExtraClass('editable-column-field');
$fields->push($field);
}

View File

@ -165,9 +165,12 @@
* GridFieldEditableColumns
*/
$('.ss-gridfield.ss-gridfield-editable .ss-gridfield-item').entwine({
onclick: function() {
// Stop the default click action when fields are clicked on.
$('.ss-gridfield.ss-gridfield-editable .ss-gridfield-item 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();
}
}
});