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

Support for Selecting rows? #250

Open
jnaylor92 opened this issue Mar 27, 2024 · 4 comments
Open

Support for Selecting rows? #250

jnaylor92 opened this issue Mar 27, 2024 · 4 comments

Comments

@jnaylor92
Copy link

I see that DataTables supports row select: https://datatables.net/examples/api/select_row.html

Is there any plan to include this in itables?

@mwouts
Copy link
Owner

mwouts commented Mar 27, 2024

Hi @jnaylor92 , well actually the selection extension is included in ITables! It's a requirement for the SearchPanes and SearchBuilder extensions.

I did not add an example for that extension since I was not sure how to use that information back in Python - do you have a plan for that?

See also #208 for an example on how to retrieve the selected row in the context of a Shiny app (with an older version of ITables).

@jnaylor92
Copy link
Author

A very simple example would be something like:

from itables.sample_dfs import get_countries
from itables import init_notebook_mode, show

init_notebook_mode(connected=False)
countries_table = show(get_countries(), connected=False)

selected_countries - countries_table.get_selected()

I really like ITables for what it gives and the way it looks in comparison to something like qgridnext which gives selection but not whole table search and pagination.

I am trying to build up an interactive form that includes displaying a table of data for the user to select samples to then do something further with. Using the above example it might be to plot the selected countries on a map using the lat / long

@mwouts
Copy link
Owner

mwouts commented Mar 28, 2024

I see. Well at the moment there is no direct way to retrieve the selected rows in ITables. That might come at a later stage when we improve the support for "apps" (i.e. Dash, Shiny, or Python widgets), but there is no ETA for that at the moment, for now ITables is "display only". Please leave the issue open though, so that I can give an update when the situation changes.

@jnaylor92
Copy link
Author

That all makes sense and it is good to hear there is a plan to head in that direction in the future. Appreciate the quick responses

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