Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.7pagination dropdown button can not select #28

Closed
chuchengcao opened this issue Aug 13, 2015 · 3 comments
Closed

0.9.7pagination dropdown button can not select #28

chuchengcao opened this issue Aug 13, 2015 · 3 comments

Comments

@chuchengcao
Copy link

I want to select 25 items per page, but the button not work
Test Code:

 const dataSet =  [
            {"objectName":"sdfsdfsdf33","userId":"chengcao.chucc","perms":["READ","WRITE"],"id":1},
            {"objectName":"sdfasd","userId":"all","perms":["READ","WRITE"],"id":2},
            {"objectName":"gggggs","userId":"all","perms":["READ"],"id":3},
            {"objectName":"时间xx","userId":"all","perms":["READ"],"id":4},
            {"objectName":"时间xxd","userId":"all","perms":["READ"],"id":5},
            {"objectName":"xm","userId":"b","perms":["READ"],"id":6},
            {"objectName":"xm","userId":"all","perms":["READ"],"id":7},
            {"objectName":"xxxxd","userId":"all","perms":["READ"],"id":8},
            {"objectName":"什么鬼3","userId":"all","perms":["READ"],"id":9},
            {"objectName":"贝贝贝d","userId":"all","perms":["READ"],"id":10},
            {"objectName":"什么鬼8","userId":"all","perms":["READ"],"id":11},
            {"objectName":"sdfsdf","userId":"all","perms":["READ"],"id":12},
            {"objectName":"秒排","userId":"b","perms":["READ"],"id":13},
            {"objectName":"牵牛","userId":"all","perms":["READ"],"id":14},
            {"objectName":"牵牛","userId":"b","perms":["READ"],"id":15}];

        return (
                    <div className='maxw80 ma'>
                        <BootstrapTable data={dataSet}
                                        striped={true} hover={true} condensed={false} search={true} pagination={true}>
                            <TableHeaderColumn className='clgrey' dataField="id" isKey={true} dataAlign="center"
                                               dataSort={true}>#</TableHeaderColumn>
                            <TableHeaderColumn dataField="objectName" dataSort={true}>任务名称</TableHeaderColumn>
                            <TableHeaderColumn dataField="userId" dataSort={true}>被授权用户</TableHeaderColumn>
                            <TableHeaderColumn dataField="perms" dataSort={true}
                                               dataFormat={(cell, row)=>(<span>{cell.toString()}</span>)}>
                                权限
                            </TableHeaderColumn>
                            <TableHeaderColumn dataField="id">
                                操作
                            </TableHeaderColumn>
                        </BootstrapTable>
                    </div>
        )

I read the source code, and find PaginationList.js:87 does not add onClick event, is it the problem?

 React.createElement(
                "button",
                { className: "btn btn-default dropdown-toggle", type: "button", id: "pageDropDown", "data-toggle": "dropdown", "aria-expanded": "true" },
                this.state.sizePerPage,
                React.createElement("span", { className: "caret" })
              ),
@AllenFang
Copy link
Owner

HI @chuchengcao, maybe this is a bug, I'll check it out. And the source code is under the src folder in repository, your codes is the bundled file, not the source code. I'll fix this issue quickly :)

@AllenFang AllenFang added the bug label Aug 13, 2015
@AllenFang
Copy link
Owner

@chuchengcao, I've tried a lots of case, but I don't get this issue. Is some class setting cause this problem? In you code, for example className='maxw80 ma'. or if table render complete at first, the dropdown is work? I think it should be work.

@AllenFang AllenFang removed the bug label Aug 13, 2015
@chuchengcao
Copy link
Author

Ah, I found where the problem is. My project does not import 'bootstrap/dist/js/bootstrap.js' which the dropdown button needs. Another lib 'react-bootstrap' worked correctly without bootstrap.js, so I miss the bootstrap.js. Sorry for cost your time....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants