1

I am trying to use a traitsui TableEditor to allow the user to interact with some data.

In the wx backend, the editor seems to dump things into the table in the Order they are listed in the trait being edited. But using the qt backend, the entries are ordered by fields.

The image below shows an example table with some items. As you can see, the toolbar indicates that the entries are currently ordered by the Electrode field, which doesnt have any __cmp__ method but does have a __str__ which I guess is good enough. The user can click on the other headings on the toolbar to order by something different, but as you can see those headings don't have any default values.

Table editor

The problem is, the Electrode field, which should be at the left side of the table, is a really useless thing to order this table by, and it makes it so that to make the correct changes to the underlying model the user may need to click through all of the items to figure out which is the right entry.

The order of the items in the list itself -- which is shown by the numbers in this table but you can't click on them -- turns out to be a much smarter order in which to present the items in this use case.

Is there some way of overriding this behavior and specifying a smarter initial order at the outset?

aestrivex
  • 5,170
  • 2
  • 27
  • 44

0 Answers0