Skip to content

Commit 0ebd83e

Browse files
ditkachukdmtrdmtr
authored andcommitted
Add multiple fixed columns, fix style bugs, remove throttle (henrybuilt#1)
* Update class names * Add dev example * Add deps * Add multi fixed columns * Add fullwidth x-scroll, fix example styles * Fix width\height scrollbar padding * Fix sticky columns widths, fix scrollbar using wrong table scroll position * Fix cell height calculation * Move to border-box height width sizing, add only real table width sizing * Fix log * Add end scroll event callback * Fix deps, fix throttle, add on scroll * Add handle scroll event on scroll content resize * Fix visible scroll in firefox and ie * Fix not full content scroll bar visible * Add onScrollEnd event * Fix performance for ie * Remove throttles from scroll event for ie * Sync two scrolls events * Fix scroll init * Fix readme * Fix lint errors, fix package.json
1 parent 427a1d0 commit 0ebd83e

23 files changed

+703
-313
lines changed

README.md

+25-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Responsive and dynamically-sized fixed headers and columns for tables inspired b
66

77
## Features
88

9-
- Optional fixed column & header
9+
- Optional fixed columns & header
1010
- Responsive table dimensions (wrap it in any size container and it will fill that container)
1111
- Dynamic row height & column width (no need to specify width and height in pixels)
1212
- Rows and columns resize as content resizes
1313
- Custom cells (just make sure your custom cell has `display: table-cell` set)
1414
- Multiple tables per page
1515
- Scrollbars that are smooth and visible at all times
1616

17-
Doesn't yet support: Multiple columns/headers, client side sorting, or IE <= 7.
17+
Doesn't yet support: Multiple headers, client side sorting, or IE <= 7.
1818

1919
## Getting Started
2020

@@ -62,7 +62,7 @@ Default settings:
6262
```javascript
6363
{
6464
stickyHeaderCount: 1,
65-
stickyColumnCount: 1
65+
stickyColumnsCount: 1
6666
}
6767
```
6868

@@ -75,7 +75,28 @@ Disable sticky header:
7575
Disable sticky column:
7676

7777
```javascript
78-
<StickyTable stickyColumnCount={0}>
78+
<StickyTable stickyColumnsCount={0}>
79+
```
80+
81+
## Events
82+
83+
Scroll event:
84+
85+
```javascript
86+
<StickyTable onScroll={function(object) {}}>
87+
```
88+
89+
Scroll event object:
90+
91+
```javascript
92+
{
93+
scrollTop: 0,
94+
scrollHeight: 2304,
95+
clientHeight: 259,
96+
scrollLeft: 0,
97+
scrollWidth: 27953,
98+
clientWidth: 887
99+
}
79100
```
80101

81102
## License

dist/Cell/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
value: function render() {
104104
return _react2.default.createElement(
105105
'div',
106-
_extends({}, this.props, { className: 'cell ' + (this.props.className || '') }),
106+
_extends({}, this.props, { className: 'sticky-table-cell ' + (this.props.className || '') }),
107107
this.props.children
108108
);
109109
}

dist/Row/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
value: function render() {
104104
return _react2.default.createElement(
105105
'div',
106-
_extends({}, this.props, { className: 'row ' + (this.props.className || '') }),
106+
_extends({}, this.props, { className: 'sticky-table-row ' + (this.props.className || '') }),
107107
this.props.children
108108
);
109109
}

dist/Table/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
value: function render() {
104104
return _react2.default.createElement(
105105
'div',
106-
_extends({}, this.props, { className: 'table ' + (this.props.className || '') }),
106+
_extends({}, this.props, { className: 'sticky-table-container ' + (this.props.className || '') }),
107107
this.props.children
108108
);
109109
}

0 commit comments

Comments
 (0)