Skip to content

Conversation

@jack-fangzj
Copy link

Short description
editable: function(record, extra) doesn't work.

What is current behavior
editable only works with object, not function.

in w2grid.js:
8476 edit = (Object.keys(col.editable ?? {}).length > 0 ? col.editable : null)
8477 if (typeof edit === 'function') {
8478 let value = this.getCellValue(ind, col_ind, false)
8479 // same arguments as col.render()
8480 edit = edit.call(this, rec, { self: this, value, index: ind, colIndex: col_ind })
8481 }

solution: 8477 and 8480, change edit to col.editable, it will work for editable when it is function.
also, many thanks to vitmalina for this great product.

8477 if (typeof col.editable === 'function') {
8478 let value = this.getCellValue(ind, col_ind, false)
8479 // same arguments as col.render()
8480 edit = col.editable.call(this, rec, { self: this, value, index: ind, colIndex: col_ind })
8481 }

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant