feat(xo-web): pass userData to SortedTable actions (#2700)
This commit is contained in:
parent
c38c716616
commit
30483ab2d9
@ -209,15 +209,19 @@ class IndividualAction extends Component {
|
|||||||
isFunction(disabled) ? disabled(item, userData) : disabled
|
isFunction(disabled) ? disabled(item, userData) : disabled
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_executeAction = () => {
|
||||||
|
const p = this.props
|
||||||
|
return p.handler(p.item, p.userData)
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { icon, label, level, handler, item } = this.props
|
const { icon, label, level } = this.props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionRowButton
|
<ActionRowButton
|
||||||
btnStyle={level}
|
btnStyle={level}
|
||||||
disabled={this._getIsDisabled()}
|
disabled={this._getIsDisabled()}
|
||||||
handler={handler}
|
handler={this._executeAction}
|
||||||
handlerParam={item}
|
|
||||||
icon={icon}
|
icon={icon}
|
||||||
tooltip={label}
|
tooltip={label}
|
||||||
/>
|
/>
|
||||||
@ -234,15 +238,19 @@ class GroupedAction extends Component {
|
|||||||
isFunction(disabled) ? disabled(selectedItems, userData) : disabled
|
isFunction(disabled) ? disabled(selectedItems, userData) : disabled
|
||||||
)
|
)
|
||||||
|
|
||||||
|
_executeAction = () => {
|
||||||
|
const p = this.props
|
||||||
|
return p.handler(p.selectedItems, p.userData)
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { icon, label, level, handler, selectedItems } = this.props
|
const { icon, label, level } = this.props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ActionRowButton
|
<ActionRowButton
|
||||||
btnStyle={level}
|
btnStyle={level}
|
||||||
disabled={this._getIsDisabled()}
|
disabled={this._getIsDisabled()}
|
||||||
handler={handler}
|
handler={this._executeAction}
|
||||||
handlerParam={selectedItems}
|
|
||||||
icon={icon}
|
icon={icon}
|
||||||
tooltip={label}
|
tooltip={label}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user