mirror of
https://github.com/symbiote/silverstripe-gridfieldextensions.git
synced 2024-10-22 17:05:39 +02:00
Merge pull request #136 from jonom/fix-click-rows
FIX clickable editable rows
This commit is contained in:
commit
84cf612582
@ -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);
|
$fields->push($field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,9 +165,12 @@
|
|||||||
* GridFieldEditableColumns
|
* GridFieldEditableColumns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$('.ss-gridfield.ss-gridfield-editable .ss-gridfield-item').entwine({
|
$('.ss-gridfield.ss-gridfield-editable .ss-gridfield-item td').entwine({
|
||||||
onclick: function() {
|
onclick: function(e) {
|
||||||
// Stop the default click action when fields are clicked on.
|
// 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