react-bootstrap-table icon indicating copy to clipboard operation
react-bootstrap-table copied to clipboard

Milestone to v3.0.0

Open AllenFang opened this issue 10 years ago • 100 comments

v3.0.0

I'm going to start a plan for [email protected], so I wonder if any ideas for v3.0.0, you can tell me in this threads. Anyway, I've considered some issues must be solve in v3.0.0(may not, it depend):

  1. Make all the components customizable(include pagination, insert button or modal etc.) There're the relative issues: #492, #469, #476, #356, #251, #172, #487, #484, #462, #456, #426 etc.
  2. Remove the column filter on bottom of table
  3. Remove the dependency for bootstrap.js

Feel free to give any suggestion or feedback. BTW, if u r interesting for contributing this repo, it's welcome

alpha todo list

Thanks @AllenFang

AllenFang avatar Jun 08 '16 06:06 AllenFang

Hi Allen, I've been using this project very heavily for some work I've done recently. Would like to contribute soon but since I've been full time on my project I've unfortunately not had time. Something I did start to work on but haven't had time to implement is the ability to copy one/multiple rows (depending on whether you've used checkbox/radio for select). The other is an import from CSV function. I've just added custom buttons for this myself but would be useful to have as part of the table. (Sorry in advance if these have been mentioned before). Some other thoughts that come to mind are: custom rendered cells available in add dialog, modal dialog being popped up for cell edit, mass paste to edit many cells at once. Thanks for all your hard work on this - it's a great project!

ghost avatar Jun 08 '16 13:06 ghost

@lbargery, I'm glad to hear your feedback.

copy one/multiple rows

it's a cool feature!

import from CSV

It's also a awesome feature, someone who has asked this feature but I just reject lol. but it's welcome to make a PR.

custom rendered cells available in add dialog, modal dialog being popped up for cell edit

that's why I want to bump to v3.0.0, it's a commons problem which a lots of user encounter.

AllenFang avatar Jun 13 '16 15:06 AllenFang

Possible to add https://github.com/AllenFang/react-bootstrap-table/issues/220 to it? Not sure what to call it maybe nested sorting? Multiple sorting? Anyway just a suggestion love what you have done so far just started using this in a project and it saved me a ton of time. Keep up the good work.

Amertz08 avatar Jun 21 '16 15:06 Amertz08

HI @Amertz08, for #220, I've no any plan to do it, I want to keep the sort simple and the sorting behavior in most table component does not support the nested sorting or something like that #220. Anyway, there's a lot of important thing need to be done, so I wont support #220 in near future, But PR is welcome 👍 sorry sir

AllenFang avatar Jun 21 '16 16:06 AllenFang

Hello @AllenFang . Thank you for you good project. It very simple for using. I'm waiting for removing bootstrap.js from project :+1:

inthedark122 avatar Jun 21 '16 19:06 inthedark122

Possible to add a view all to the pagination? EDIT: realized there is an easy workaround for this.

Amertz08 avatar Jun 22 '16 19:06 Amertz08

@Amertz08, it's a much custom functionality for users. Maybe I will try to implement it. :)

there is an easy workaround for this

so what's that?

AllenFang avatar Jun 23 '16 02:06 AllenFang

Hi,

My suggestions:

  • have data not being only an array. It could be an array but it could also be an object which provide getCount() and getItem() (promise) methods so data loading could be lazy. In this case, of course, sorting/filtering should also be custom callbacks.
  • I had problems with the default "height=100%" : pagination was outside of the screen. Never found why. But I had to use "height=auto" and I wonder if it shouldn't be the default value
  • For custom buttons, there should be a way to ling them to selected data : the button is always clickable and expect no data OR the button can only be clicked if data is selected and expect the datas as a parameter .

Also, I did not found any "developper" page which explain how to contribute, package, ... It may be obvious for javascript developpers, but I'm not and I need some time to understand.

Tell us when you'll make the branch so we can contibute.

mbaroukh avatar Jun 23 '16 06:06 mbaroukh

@AllenFang I need the ability to provide custom cell editors ( see #162)

I'm going to start on a PR. Will model it after how the custom column filter components are implemented. Will ask for feedback on the interface before I get too far.

abhirao avatar Jun 23 '16 16:06 abhirao

class Parent extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            pagination: true
        };
    }

    _togglePagination() {
        this.setState({ pagination: !this.state.pagination });
    }

    render() {
        return (
            <div>
                <button onClick={ ::this._togglePagination } >Toggle</button>
                <BootstrapTable
                    pagination={this.state.pagination}>
                </BootstrapTable>
            </div>
        )
    }
}

@AllenFang hacky but it worked.

Amertz08 avatar Jun 23 '16 16:06 Amertz08

@mbaroukh, I'll thinks about your suggestion, and will open a branch for v3.0.0. Sorry for lately reply, I'm busy on work ;(

AllenFang avatar Jun 26 '16 15:06 AllenFang

hey thanks for the next versions. If we can have resizable columns , that will be great..

ssjogus avatar Jun 29 '16 09:06 ssjogus

also one more wish -

for filter: can we have a button, clicking on which the filter row opens up..

something like attached screenshot. i did this using jquery.. but it will be good to have in the plugin itself..

Screenshot1 - filter controls hidden image

Screenshot2 - on click of icons in the header, the filter row opens image

ssjogus avatar Jun 29 '16 09:06 ssjogus

@ssjogus, your suggestion is very well, I will consider it :) Thanks you. But it really need some time ;(

AllenFang avatar Jun 30 '16 08:06 AllenFang

Following is the proposal for showing how to do custom component: Firstly, if you only want to custom the button(e.g., insertRow, exportCVS) or search field, you can do it like that:

function generateDeleteBtn(delBtnClick) {
 return (
    <button onClick={ delBtnClick }>MyDeleteBtn</button>
 );
}
render() {
  return(
    <BootstrapTable insertRow deleteRow={ generateDeleteBtn }>
      //...
    </BootstrapTable>
  );
}

However, if you need to customize the whole ToolBar, e.g., add you component, change the layout. You can do it like following:

function generateInsertBtn(onClick) {
 return (
    <button>MyInsertBtn</button>
 );
}

function generateSearchField(onKeyUp) {
  return (
     <input type='text' />
  );
}

<BSTableToolBar style={ { ... } } className={ ... }>
  <InsertBtn component={ generateInsertBtn }/>
  <div style={ { ... } }>
    <Search component={ generateSearchField }/>
  </div>
</BSTableToolBar>
<BootstrapTable toolBar insertRow deleteRow>
</BootstrapTable>

You need to enable toolBar props on <BootstrapTable>, if configured, I will assume you want to customize the tool bar so that you need to render <BSTableToolBar> component and it's body. Which means react-bootstrap-table does not render insert button depends on insertRow={true}, so insertRow, deleteRow, exportCSV will all invalid. In this situation, you have best ability to do customization. BTW, I will export e.g., InsertBtn, DeleteBtn, ExportCSVBtn components, if you only want to change the styles or layout on ToolBar and it's easy to be done.

Hope it all works and feel free to discuss for this proposal. Thanks you :)

AllenFang avatar Jul 02 '16 12:07 AllenFang

v3.0.0 alpha todo list

  • [x] ToolBar customizable
  • [x] Insert button customizable
  • [x] delete button customizable
  • [x] exportCSV button customizable
  • [x] search field customizable
  • [x] Remove dependencies on jQuery and bootstrap.js
  • [x] Use other modal library instead of native bootstrap modal
  • [x] Insert modal customizable
  • [x] Selection cell customizable(Released on v2.4.2)
  • [x] Size per page dropdown customizable
  • [x] Cell edit customizable(Released on v2.4.0)

I know there're some features I miss, but I thinks make the react-bootstrap-table more customizable is most important thing than each other in the future, so if any feature I miss, I'll consider to add it after alpha release.

The branch I've created v3.0.0-dev. Thanks again :0

AllenFang avatar Jul 02 '16 15:07 AllenFang

Hi @AllenFang ,

How about add new button(for example )?

Thanks,

tarim avatar Jul 05 '16 16:07 tarim

@ssjogus I was able to use react-resizable to create resizable columns for react-bootstrap-table. Try it out to see if that solves your problem. Let me know if you would like me to share a gist example.

abhirao avatar Jul 05 '16 18:07 abhirao

@tarim, it's in the scope of ToolBar customizable, actually, I'll give you more ability to do anything.

AllenFang avatar Jul 06 '16 16:07 AllenFang

@abhirao thanks for the plugin suggestion. but will it work with the columns? i dont want to resize the whole table, but the columns should be resizable..

ssjogus avatar Jul 11 '16 10:07 ssjogus