Skip to content

Commit 98a411c

Browse files
committed
pass row index to format function on render ToolBar
1 parent eae2f23 commit 98a411c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BootstrapTable.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ class BootstrapTable extends Component {
761761
|| this.props.exportCSV) {
762762
let columns;
763763
if (Array.isArray(children)) {
764-
columns = children.map(function(column) {
764+
columns = children.map((column, r) => {
765765
const { props } = column;
766766
return {
767767
name: props.children,
@@ -772,7 +772,7 @@ class BootstrapTable extends Component {
772772
// for create editor, no params for column.editable() indicate that editor for new row
773773
editable: props.editable && (typeof props.editable === 'function') ? props.editable() : props.editable,
774774
format: props.dataFormat ? function(value) {
775-
return props.dataFormat(value, null, props.formatExtraData).replace(/<.*?>/g, '');
775+
return props.dataFormat(value, null, props.formatExtraData, r).replace(/<.*?>/g, '');
776776
} : false
777777
};
778778
});

0 commit comments

Comments
 (0)