title: Ant Design - How can i get count of table row after filtering?
body: <p>I use Table component from Ant-design to search, filtering and sort a big set of data but I have a problem with "Select all Data".</p>
  
  <p>For example if I click on checkbox on top of table, only display rows on screen are selected. So if I change of page, the others rows aren't selected. If I want select all data I need to custom selection and use <code>rowSelection.selections</code>. </p>
  
  <p>As you can see on this example extract from <a href="https://ant.design/components/table/#components-table-demo-row-selection-custom" rel="noreferrer">ant.design website</a> below,
  the proposal solution is to write directly all keys of row that I need to select, but if I have filtered just before one column I can't know the state of my props datasource. </p>
  
  <p>So my question is: How can I know all the data currently available on the screen?</p>
  
  <p>For example, If there is 10 pages initially, and then I filter and sort, and now there is 2 pages, how get the array of new set of data.</p>
  
  <p>Thanks in advance. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class App extends React.Component {
    state = {
      selectedRowKeys: [], // Check here to configure the default column
    };
  
    onSelectChange = (selectedRowKeys) =&gt; {
      console.log('selectedRowKeys changed: ', selectedRowKeys);
      this.setState({ selectedRowKeys });
    }
  
    render() {
      const { selectedRowKeys } = this.state;
      const rowSelection = {
        selectedRowKeys,
        onChange: this.onSelectChange,
        hideDefaultSelections: true,
        selections: [{
          key: 'all-data',
          text: 'Select All Data',
          onSelect: () =&gt; {
            this.setState({
              selectedRowKeys: [...Array(46).keys()], // 0...45
            });
          },
        }, {
          key: 'odd',
          text: 'Select Odd Row',
          onSelect: (changableRowKeys) =&gt; {
            let newSelectedRowKeys = [];
            newSelectedRowKeys = changableRowKeys.filter((key, index) =&gt; {
              if (index % 2 !== 0) {
                return false;
              }
              return true;
            });
            this.setState({ selectedRowKeys: newSelectedRowKeys });
          },
        }, {
          key: 'even',
          text: 'Select Even Row',
          onSelect: (changableRowKeys) =&gt; {
            let newSelectedRowKeys = [];
            newSelectedRowKeys = changableRowKeys.filter((key, index) =&gt; {
              if (index % 2 !== 0) {
                return true;
              }
              return false;
            });
            this.setState({ selectedRowKeys: newSelectedRowKeys });
          },
        }],
        onSelection: this.onSelection,
      };
      return (
        &lt;Table rowSelection={rowSelection} columns={columns} dataSource={data} /&gt;
      );
    }
  }</code></pre>
  </div>
  </div>
  </p>