MCPcopy Create free account
hub / github.com/Lobos/react-ui / onSelect

Method onSelect

src/Table.js:82–103  ·  view source on GitHub ↗
(i, e)

Source from the content-addressed store, hash-verified

80 }
81
82 onSelect (i, e) {
83 var checked = typeof e === 'boolean' ? e : e.target.checked,
84 data = this.state.data,
85 index = this.state.index,
86 size = this.props.pagination ? this.props.pagination.props.size : data.length,
87 start = 0,
88 end = 0,
89 lastSize = data.length % size,
90 lastIndex = parseInt(data.length / size + 1);
91 if (i === 'all') {
92 start = (index - 1) * size;
93 end = index === lastIndex ? (index - 1) * size + lastSize : index * size;
94 } else {
95 start = (index - 1) * size + i;
96 end = start + 1;
97 }
98
99 for (; start < end; start++) {
100 data[start].$checked = checked;
101 }
102 this.setState({data});
103 }
104
105 getSelected (name) {
106 let values = [];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected