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

Selected row page #353

Closed
dana2208 opened this issue Mar 23, 2016 · 11 comments
Closed

Selected row page #353

dana2208 opened this issue Mar 23, 2016 · 11 comments

Comments

@dana2208
Copy link
Contributor

Hello @AllenFang ,

I have selected a row from an external action by passing the selected array to the selectedRow props of the BootstrapTable.
Is there a way I can know in which page is the selected row?
I would like to be able to jump to that page when it is selected, either right after the selection or at the same time as it is selected by passing the page in the options props of the BootstrapTable together with the selected array.

Thanks

@AllenFang
Copy link
Owner

HI @dana2208, The question is you want to get the pages which contain selected rows, right?
I think there's no way to do it. How about I expose an API on BootstrapTable which can let you get these selected row pages?

@AllenFang
Copy link
Owner

btw, did you need to know the page which every selected row located?

@dana2208
Copy link
Contributor Author

Hi,

I would like either to get the page numbers

  1. before passing the array of selected row keys,
  2. or after passing the array of selected row keys.
    First solution would be better because I could update props of the BootstrapTable (selected and page) in the same setState call but second solution will be OK too.

Currently I am working in mode "radio" so I need only one page number, but it is better to support already the "checkbox" mode (multi-selection) so if you implement it, it is better to get an array of the pages.

What do you think?

@madeinfree
Copy link
Contributor

Hi @dana2208, I guess you want to click the checkbox and get the current page of selected row key for more than one page ?

like you have 15 items and you setting the 10 items per page,

  1. first step you click the no.7 item and you can get the [1]
  2. second step you click the no.13 item and you can get the [2]
    or you want to get the [1,2] ?

is that right ?

@dana2208
Copy link
Contributor Author

Hi,

No, my selection is done externally.
I am clicking an entity on a map and i want it selected in the bootstrap table grid that is displayed below the map.
So when clicking on the map i get the id of the entity which i put in the selected array of the selectRow prop of BootstrapTable. I would like to get the page in which this selected row key is in the grid so that I also can go to this page through the page props.

@AllenFang
Copy link
Owner

@dana2208, I understand, maybe like I said, just give you a exposed API for you to get the page of selected row key, I think it should solve this issues. if ok, I'll done it in these day :)

@AllenFang
Copy link
Owner

hi @dana2208, @madeinfree is a new contributor who I found for helping me. Because, I'm busy in these day(always busy...lol). btw, I'll ask him support this feature at next version. Feel free to discuss with him and me 👍

@AllenFang AllenFang assigned AllenFang and unassigned AllenFang Mar 24, 2016
@madeinfree
Copy link
Contributor

@dana2208 Ok, I understand and I will support that feature.

@AllenFang Thanks, i will try it.

@dana2208
Copy link
Contributor Author

Hi @madeinfree, welcome as a new contributor and good luck! Yes I am very interested in this feature. Pay attention that page number of the selected item depends on the current sorting and filtering and also the number of rows displayed on each page. Thanks!

madeinfree added a commit to madeinfree/react-bootstrap-table that referenced this issue Mar 24, 2016
This was referenced Mar 24, 2016
@AllenFang
Copy link
Owner

@dana2208, #358 could help to support this feature, just call getPageByRowKey(your_selected_rowkey) function exposed by BootstrapTable. This function will return the page number.

@AllenFang
Copy link
Owner

Fixed on v2.1.0, check example :) Thanks

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

3 participants