Jupyter lab packages (if applicable): $ jupyter labextension list
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
@jupyter-widgets/jupyterlab-sidecar v0.5.0 enabled OK
jupyter-leaflet v0.13.2 enabled OK
jupyter-vue v1.4.1 enabled OK
qgrid2 v1.1.3 enabled OK
Description of Issue
I show numeric values formatted in columns such that they become clickable hyperlinks, think GitLab project IDs pointing to the respective webpage, using something like f'<a href="http://foo.com/project/{id}">{id}</a>'which works, but...
What did you expect to happen?
When sorting by that column I would hope to see the value of the original values (numeric or string) preserved.
What happened instead?
Instead, when I sort by the respective column, the values are (of course) no longer correctly sorted, and I see numeric (clickable) values ordered like 20, 3, 500, instead of 3, 20, 500.
Reproduction Steps
import pandas as pd
import qgrid
data = [(f'<a href="http://foo.com/{a}">{a}</a>', b, c)
for [a, b, c] in [(500, 2, 3), (3, 3, 4), (20, 4, 5)]
]
df = pd.DataFrame(data, columns=["A", "B", "C"])
qgrid.show_grid(df)
# then sort by column "A"
What steps have you taken to resolve this already?
I can workaround this only by adding another data column without formatting to a hyperlink, but that looks questionable and superfluous for regular users. It would be nicer to indicate the original values by which some column should be sorted in some other way.
Environment
$ pip freeze
or$ conda list
(please include qgrid, notebook, and jupyterlab versions)$ jupyter labextension list
Description of Issue
I show numeric values formatted in columns such that they become clickable hyperlinks, think GitLab project IDs pointing to the respective webpage, using something like
f'<a href="http://foo.com/project/{id}">{id}</a>'
which works, but...When sorting by that column I would hope to see the value of the original values (numeric or string) preserved.
Instead, when I sort by the respective column, the values are (of course) no longer correctly sorted, and I see numeric (clickable) values ordered like 20, 3, 500, instead of 3, 20, 500.
Reproduction Steps
What steps have you taken to resolve this already?
I can workaround this only by adding another data column without formatting to a hyperlink, but that looks questionable and superfluous for regular users. It would be nicer to indicate the original values by which some column should be sorted in some other way.