非死book React 組件:fixed-data-table
fixed-data-table 是一個用于以靈活且強有力的方式建立并顯示數據的 React 組件。它支持標準的桌面特征,像頭條、行、列、頭條組、滾動列。此組件在處理數千行數據的時不會犧牲性能。平滑地滾定是 FixedDataTable 的首要目的,它的結構保證了它的靈活性和可擴展性。
示例代碼:
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') );
本文由用戶 gxw6 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!