fixed-data-tableFacebook React 組件
fixed-data-table 是一個用于以靈活且強有力的方式建立并顯示數(shù)據(jù)的 React 組件。它支持標(biāo)準(zhǔn)的桌面特征,像頭條、行、列、頭條組、滾動列。此組件在處理數(shù)千行數(shù)據(jù)的時不會犧牲性能。平滑地滾定是 FixedDataTable 的首要目的,它的結(jié)構(gòu)保證了它的靈活性和可擴(kuò)展性。
示例代碼:
var React = require('react');
var FixedDataTable = require('fixed-data-table');
var Table = FixedDataTable.Table;
var Column = FixedDataTable.Column;// Table data as a list of array.var rows = [
['a1', 'b1', 'c1'],
['a2', 'b3', 'c2'],
['a3', 'b3', 'c3'],
..... /// and more];function rowGetter(rowIndex) { return rows[rowIndex];
}
React.render( <Table
rowHeight={50}
rowGetter={rowGetter}
rowsCount={rows.length}
width={5000}
height={5000}
headerHeight={50}>
<Column
label="Col 1"
width={3000}
dataKey={0}
/>
<Column
label="Col 2"
width={2000}
dataKey={1}
/>
</Table>, document.getElementById('example')
);評論
圖片
表情
