mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
refine remote method
This commit is contained in:
parent
b1c086f424
commit
400c307871
@ -16,7 +16,7 @@ const withContext = Base =>
|
||||
|
||||
if (props.columns.filter(col => col.sort).length > 0) {
|
||||
this.SortContext = createSortContext(
|
||||
dataOperator, this.isRemoteSort, this.handleSortChange);
|
||||
dataOperator, this.isRemoteSort, this.handleRemoteSortChange);
|
||||
}
|
||||
|
||||
if (props.selectRow) {
|
||||
@ -25,7 +25,7 @@ const withContext = Base =>
|
||||
|
||||
if (props.cellEdit && props.cellEdit.createContext) {
|
||||
this.CellEditContext = props.cellEdit.createContext(
|
||||
_, dataOperator, this.isRemoteCellEdit, this.handleCellChange);
|
||||
_, dataOperator, this.isRemoteCellEdit, this.handleRemoteCellChange);
|
||||
}
|
||||
|
||||
if (props.filter) {
|
||||
@ -146,7 +146,7 @@ const withContext = Base =>
|
||||
renderWithFilterCtx(base, baseProps) {
|
||||
return (
|
||||
rootProps,
|
||||
cellEditprops
|
||||
cellEditProps
|
||||
) => (
|
||||
<this.FilterContext.Provider
|
||||
{ ...baseProps }
|
||||
@ -157,7 +157,7 @@ const withContext = Base =>
|
||||
{
|
||||
filterProps => base(
|
||||
rootProps,
|
||||
cellEditprops,
|
||||
cellEditProps,
|
||||
filterProps
|
||||
)
|
||||
}
|
||||
@ -175,7 +175,7 @@ const withContext = Base =>
|
||||
>
|
||||
<this.CellEditContext.Consumer>
|
||||
{
|
||||
cellEditprops => base(rootProps, cellEditprops)
|
||||
cellEditProps => base(rootProps, cellEditProps)
|
||||
}
|
||||
</this.CellEditContext.Consumer>
|
||||
</this.CellEditContext.Provider>
|
||||
|
||||
@ -69,11 +69,11 @@ export default ExtendBase =>
|
||||
this.props.onTableChange('filter', this.getNewestState(newState));
|
||||
}
|
||||
|
||||
handleSortChange = (sortField, sortOrder) => {
|
||||
handleRemoteSortChange = (sortField, sortOrder) => {
|
||||
this.props.onTableChange('sort', this.getNewestState({ sortField, sortOrder }));
|
||||
}
|
||||
|
||||
handleCellChange = (rowId, dataField, newValue) => {
|
||||
handleRemoteCellChange = (rowId, dataField, newValue) => {
|
||||
const cellEdit = { rowId, dataField, newValue };
|
||||
this.props.onTableChange('cellEdit', this.getNewestState({ cellEdit }));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user