Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/object-cell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ class ObjectCell extends React.Component {
handleDoubleClick = (event) => {
this.beginEdit()
}
editable(objectId) {
return cellIsEditable(objectId, this.props.column)
editable(object) {
return cellIsEditable(object, this.props.column)
}
beginEdit = (editReplaceOverride) => {
if (!this.props.disabled && this.editable(this.getCellRef().objectId)) {
if (!this.props.disabled && this.editable(this.props.object)) {
this.props.beginEdit(this.getCellRef(), editReplaceOverride)
}
}
Expand Down Expand Up @@ -137,7 +137,7 @@ class ObjectCell extends React.Component {

let cellProps = {
className: classNames(classes + ' drawer ' + drawer.className, {
uneditable: (!this.editable(this.getCellRef().objectId)),
uneditable: (!this.editable(this.props.object)),
}),
}
if (!this.props.column.disableInteraction) {
Expand Down
4 changes: 2 additions & 2 deletions src/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ function dictFirstKey(dict) {
return undefined
}

function cellIsEditable(objectId, column) {
function cellIsEditable(object, column) {
const { isReadOnly, editor } = column
const editorIsSet = editor !== false
const readOnly = typeof isReadOnly === 'function' ? isReadOnly(objectId) : (isReadOnly === true)
const readOnly = typeof isReadOnly === 'function' ? isReadOnly(object) : (isReadOnly === true)
return editorIsSet && !readOnly
}

Expand Down