question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dropdown menu on paging does not work

See original GitHub issue

Hi, i don’t know what wrong with my code but the dropdown menu on paging does not show anything when i click, the other functions work well:

import boostrapTable from 'react-bootstrap-table/dist/react-bootstrap-table-all.min.css';
import React from 'react';
import { Grid } from 'react-mdl';
import { Col} from 'react-bootstrap';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
import Page from '../Page/PageComponent';

const userData = [];

export default class Program extends React.Component {
  static propTypes = {
    viewer: React.PropTypes.object.isRequired,
  };


  render() {
    function imageFormatter(cell, row) {
      if (cell) {
        return '<image src="' + cell + '" class="img-circle"/>';
      }
      return '<i style="height: 50px; width:50px; font-size: 50px" class="material-icons mdl-list__item-avatar">person</i>';
    }
    if (this.props.viewer != null) {
      return (
        <div>
          <Page heading='Users'>
            <Grid>
                {this.props.viewer.groups.map((group) => {
                  if (group.connections.length > 0) {
                    return group.connections.map((connection) => {
                      if (!connection.user) {
                        return ('');
                      }
                      userData.push(connection.user);
                    });
                  }
                })
              }
              <Col xs={12} sm={12} md={10} style={{ marginLeft: 50, marginRight: 50 }}>
                <BootstrapTable
                  data={userData}
                  hover={true}
                  pagination={true}
                  search={true}
                  exportCSV={true}>
                  <TableHeaderColumn dataField='connectionID' isKey={true} hidden={true} dataSort={true}>ID</TableHeaderColumn>
                  <TableHeaderColumn width='70px' dataField='photo' dataFormat={imageFormatter}>Photo</TableHeaderColumn>
                  <TableHeaderColumn dataField='name' dataSort={true}>Name</TableHeaderColumn>
                  <TableHeaderColumn dataField='roles' dataSort={true}>Roles</TableHeaderColumn>
                </BootstrapTable>
              </Col>
            </Grid>
          </Page>
        </div>
      );
    }
    return (
      <div>
        <Page heading='Users'>
          <h2>No Users</h2>
        </Page>
      </div>
    );
  }
}

I also got the same problem with issue#781, please fix the width of the table header to match table body. Thank you, your work is amazing

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
AllenFangcommented, Nov 24, 2016

You are right, actually the jQuery depend from bootstrap.js. Anyway, this both dependencies will be remove in the near future(v3.0.0-beta.2)

0reactions
AllenFangcommented, Jan 5, 2017

remember add jquery and bootstrap.js, but if you want to get rid of them, you can try v3.0.0-beta.6. Your choice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap Table pagination dropdown not working - Rails
The pagination works fine but the dropdown for choosing the page size does not open. It looks like a clickable dropdown menu but...
Read more >
Problems with Grid paging after filling it with DropDownList ...
Hello team. I am filling a Grid based on the selection I make of the DropDownList, this is achieved by sending the value...
Read more >
Dropdown menu not working after using custom PJAX code ...
This custom code seems to have affected my dropdown menu in some capacity to where it will open on the first page, but...
Read more >
pagination not working when I select the page from dropdown
this is my pagination layout, whenever I select the page from dropdown menu the pagination does not work but it works fine when...
Read more >
Dropdowns · Bootstrap v5.1
For this reason, Bootstrap does not expect (nor automatically add) any of the ... Wrap the dropdown's toggle (your button or link) and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found