DefinitelyTyped/react-bootstrap-table/react-bootstrap-table-tests.tsx
Ryan Cavanaugh f55497c988 Merge remote-tracking branch 'upstream/master' into merge_7_25
# Conflicts:
#	convict/convict.d.ts
#	multer/multer.d.ts
#	nodemailer/nodemailer.d.ts
#	react-bootstrap-table/react-bootstrap-table.d.ts
#	react-dnd/react-dnd-tests.ts
#	react-native/index.d.ts
#	request/request.d.ts
#	restify/index.d.ts
#	webpack/webpack.d.ts
#	ws/ws.d.ts
2016-07-27 16:12:49 -07:00

30 lines
926 B
TypeScript

/// <reference types="react-dom"/>
import * as React from 'react';
import { render } from 'react-dom';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
var 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: any, row: any) {
return '<i class="glyphicon glyphicon-usd"></i> ' + cell;
}
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} editable={{ type: 'textarea', rows: 10 }}>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField="price" dataFormat={priceFormatter}>Product Price</TableHeaderColumn>
</BootstrapTable>,
document.getElementById("app")
);