Skip to content

ObjectColumn with TextEditor does not update values in TableEditor #2065

@yves-surrel

Description

@yves-surrel

With my MacBookPro and Sequoia 15.2, traitsui 8.0.0, traits 6.4.3, with the following code:

from traits.api import HasTraits, Float, List
from traitsui.api import View, Item, TableEditor, ObjectColumn, TextEditor

class NumericItem(HasTraits):
    value = Float()

class NumericList(HasTraits):
    items = List(NumericItem)

    view = View(
        Item(
            'items',
            editor=TableEditor(
                columns=[
                    ObjectColumn(name='value', editor=TextEditor(enter_set=True))
                ],
                editable=True,
            ),
        ),
        resizable=True
    )

if __name__ == "__main__":
    numeric_list = NumericList(items=[NumericItem(value=1.0), NumericItem(value=2.5), NumericItem(value=3.8)])
    numeric_list.configure_traits()

the values revert to their original values when the edition of the cell completes (enter key pressed and cell editor exited)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions