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

Unable to edit dataTable cell #7891

Closed
ongietorri opened this Issue May 11, 2018 · 13 comments

Comments

Projects
None yet
5 participants
@ongietorri
Copy link

ongietorri commented May 11, 2018

I'm using Bokeh 0.12.15 (latest) and after I modify a DataTable cell, I can't save the update. The only thing I can do is focus to the cell and press escape, otherwise the whole DataTable looses focus and is not selectable nor editable.

Is this a regression?

Minimal example:

df = pd.DataFrame([[0, 1,2],[1,4,5], [0,5,6]])
df.columns = ['x', 'one', 'two']
cds = ColumnDataSource(df)

columns = [
        TableColumn(field="one", title="ONE", editor=IntEditor()),
        TableColumn(field="two", title="TWO")
    ]

dt = DataTable(source=cds, columns=columns, 
               sortable=True, editable=True, fit_columns=True, selectable=True)

show(dt)

image

It's the same behavior whether using a notebook or not.

Also, it seems the IntEditor has no effect whatsoever.

Thanks

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented May 11, 2018

This is a duplicate of #7736 which was resolved in #7737 (to appear in 0.12.16)

@ongietorri

This comment has been minimized.

Copy link
Author

ongietorri commented May 15, 2018

@bryevdv I tried it in 0.12.16 and now the datatable is not editable anymore, even when editable=True.

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented May 15, 2018

@ongietorri please provide a complete script that we can run as-is and we will investigate.

@ongietorri

This comment has been minimized.

Copy link
Author

ongietorri commented May 15, 2018

hello @bryevdv, the code provided in this ticket can be used as is.

# first cell of notebook
from bokeh.models.widgets.tables import DataTable, IntEditor
from bokeh.models import ColumnDataSource, TableColumn
from bokeh.plotting import output_notebook, show

import pandas as pd

import bokeh
print bokeh.__version__

output_notebook()

# second cell of notebook
df = pd.DataFrame([[0, 1,2],[1,4,5], [0,5,6]])
df.columns = ['x', 'one', 'two']
cds = ColumnDataSource(df)

columns = [
        TableColumn(field="one", title="ONE", editor=IntEditor()),
        TableColumn(field="two", title="TWO")
    ]

dt = DataTable(source=cds, columns=columns, 
               sortable=True,
               editable=True, 
               selectable=True)

show(dt)

image

The result is the same with a bokeh server.

Thanks

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented May 15, 2018

the code provided in this ticket can be used as is.

@ongietorri Respectfully that is not true, the original code in the ticket did not have imports (images of code cannot be copied and pasted and are generally worthless). There are many tens (hundreds?) of thousands of users, and only two core devs. Adding a few imports or missing code may not seem like alot, but when you multiply it across the entire user base it becomes a large burden for just a few people. In the interests of fairness and sustainability, we must insist on complete (text) code samples.

Now, with complete code I can confirm a bug. I am currently traveling for a family medical situation, but will look at it when I am able.

@mattpap any ideas what's going on her? I thought we fixed this. It's not even activating the editor at all now. We absolutely have to find some way to maintain this under test.

@bryevdv bryevdv reopened this May 15, 2018

@bryevdv bryevdv changed the title Unable to save edit in dataTable cell Unable to edit dataTable cell May 15, 2018

@bryevdv bryevdv added this to the 0.13.0 milestone May 15, 2018

@ongietorri

This comment has been minimized.

Copy link
Author

ongietorri commented May 15, 2018

Thanks @bryevdv. I will provide full code from the beginning next time.

@mattpap

This comment has been minimized.

Copy link
Contributor

mattpap commented May 24, 2018

The regression happened in PR #7818. Reverting it helps, though there are still some unrecoverable stylistic issues after editing. With that PR applied, strange things happen. Double click event, which is responsible for enabling edit mode, is not routed correctly, if at all, thus there is no way to have an editor initialized. It seems that the way slickgrid sets up click and double click events with jquery, shouldn't work reliably in general, I replaced that code with hammerjs. With event routing fixed, editable mode still doesn't work, because as soon as editor is created, slickgrid returns to display mode. This is because it thinks that the active cell changed, but it didn't. At this point I don't know what's the underlying cause.

@zanapepaj

This comment has been minimized.

Copy link

zanapepaj commented Aug 14, 2018

Was this issue fixed? I have version 12.16 and table is not editable.

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Aug 14, 2018

Fixed for 0.13

@zanapepaj

This comment has been minimized.

Copy link

zanapepaj commented Aug 20, 2018

For testing purposes (client request) I need to work on windows. I guess the latest upgrade hasn't been implemented in windows yet.

@bryevdv

This comment has been minimized.

Copy link
Member

bryevdv commented Aug 20, 2018

@zanapepaj I don't really understand what you are saying specifically. Are you saying things work on other plaforms, but don't work on windows? If that's the case, what versions (of bokeh, browser, and windows). Also if that's the case, it would be more helpful for you to make a new issue (with all that information, and a test script to reproduce the problem) so that we can tag it appropriately as windows-specific.

@chesucr

This comment has been minimized.

Copy link
Contributor

chesucr commented Aug 21, 2018

I am working on Windows 10, Chromium 61.0.3163.100 and bokeh 1.0.0.dev2 and this example is working well for me.

from bokeh.models import ColumnDataSource
from bokeh.models.widgets import DataTable, TableColumn, StringEditor, IntEditor
import pandas as pd
from bokeh.io import output_notebook, show
output_notebook()

df = pd.DataFrame([[0, 1,2],[1,4,5], [0,5,6]])
df.columns = ['x', 'one', 'two']
cds = ColumnDataSource(df)

columns = [
    TableColumn(field="one", title="ONE", editor=IntEditor()),
    TableColumn(field="two", title="TWO")
]

dt = DataTable(source=cds, columns=columns, 
               sortable=True, editable=True, fit_columns=True, selectable=True)

show(dt)
@zanapepaj

This comment has been minimized.

Copy link

zanapepaj commented Aug 21, 2018

Sorry, I wasn't too descriptive in the message above. I tried to install the latest version 0.13.0 by running:
conda install bokeh
Still getting only version 0.12.16. Am I doing something wrong?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment