mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
parent
223627fef9
commit
126b1d543c
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user