【问题标题】:Is there a way to customize pagination using the reactable library有没有办法使用可反应库自定义分页
【发布时间】:2017-03-28 05:33:47
【问题描述】:

我正在为可反应的表格创建分页。添加分页功能在文档中明确说明,使用itemsPerPage 和pageButtonLimit:

<Table className="table" data={[
    { Name: 'Griffin Smith', Age: '18' },
    { Age: '23',  Name: 'Lee Salminen' },
    { Age: '28', Position: 'Developer' },
    { Name: 'Griffin Smith', Age: '18' },
    { Age: '30',  Name: 'Test Person' },
    { Name: 'Another Test', Age: '26', Position: 'Developer' },
    { Name: 'Third Test', Age: '19', Position: 'Salesperson' },
    { Age: '23',  Name: 'End of this Page', Position: 'CEO' },
]} itemsPerPage={4} pageButtonLimit={5} />

但是,分页的挑战在于,能够自定义分页容器的外观。我正在使用以下类reactable-pagination 来自定义分页容器。但是,这非常具有挑战性,因为它会影响表格的外观。

我查看了以下 GitHub 问题,但它似乎没有解决我的问题。 Make it possible to style pagination

我正在使用 React 和 Sass,所以请不要回复 jQuery DOM 操作答案。

【问题讨论】:

    标签: javascript reactjs npm sass


    【解决方案1】:

    【讨论】:

    • 既然,这还是个PR,不是库的集成部分,你是不是直接在node模块中覆盖了模块?如果是这种情况,您将来如何处理库的任何更新?另外,我使用的是基础,而不是引导程序。
    • 我将它分叉,将更改提交到我的分叉,然后通过我的package.json:"reactable": "github:kevincolten/reactable#8e3b32c" 引入分叉
    猜你喜欢
    • 2020-10-12
    • 2013-06-10
    • 2019-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-05
    相关资源
    最近更新 更多