React-bootstrap-table2: Can icons be added to table row column value?

Created on 25 Jul 2018  路  4Comments  路  Source: react-bootstrap-table/react-bootstrap-table2

I've been scouring the documentation but I'm still not certain this is feasible, but can an icon be specified in the table data / columns such that I can render generic icons controls along with my normal row text, e.g. trash-o, exclamation-triangle etc?

Most helpful comment

Hi @cnav007 Are you seeking this?
column formatter

const formatWithIcon = (cell,row) => {
    return(
        <span><Glyphicon glyph="zoom-in"/>cell</span>
    )
}

const columns = [
   {
        dataField:'products',
        text:'products',
    }, {
        dataField:'type',
        text:'type',
    }, {
        dataField:'date',
        text:'dateWithIcon',
        formatter: formatWithIcon,
    }
];

All 4 comments

Hi @cnav007 Are you seeking this?
column formatter

const formatWithIcon = (cell,row) => {
    return(
        <span><Glyphicon glyph="zoom-in"/>cell</span>
    )
}

const columns = [
   {
        dataField:'products',
        text:'products',
    }, {
        dataField:'type',
        text:'type',
    }, {
        dataField:'date',
        text:'dateWithIcon',
        formatter: formatWithIcon,
    }
];

thanks guys!

Is it possible to render icons inside column cells without having any other corresponding text that's coming from the data source? I'm just trying to make a column of right-facing arrows at the end of each row.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eylonronen picture eylonronen  路  3Comments

rsgoss picture rsgoss  路  4Comments

Randore picture Randore  路  3Comments

dillobird picture dillobird  路  3Comments

harishkumarreddy12 picture harishkumarreddy12  路  3Comments