您可以创建一个新功能
buttonFormatter以将按钮添加到列的每个单元格
// products will be presented by react-bootstrap-tablevar products = [{ id: 1, name: "Item name 1", price: 100},{ id: 2, name: "Item name 2", price: 100},........];// It's a data format example.function priceFormatter(cell, row){ return '<i ></i> ' + cell;},function buttonFormatter(cell, row){ return '<BootstrapButton type="submit"></BootstrapButton>';}React.render( <BootstrapTable data={products} striped={true} hover={true}> <TableHeaderColumn dataField="id" isKey={true} dataAlign="center" dataSort={true}>Product ID</TableHeaderColumn> <TableHeaderColumn dataField="name" dataSort={true}>Product Name</TableHeaderColumn> <TableHeaderColumn dataField="price" dataFormat={priceFormatter}>Product Price</TableHeaderColumn> <TableHeaderColumn dataField="button" dataFormat={buttonFormatter}>Buttons</TableHeaderColumn> </BootstrapTable>, document.getElementById("app"));
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)