mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
# 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
30 lines
926 B
TypeScript
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")
|
|
);
|