CygnusX1
CygnusX1

Reputation: 21818

Can Dear ImGui tables be sorted from somewhere else?

By default ImGui tables can be sorted by clicking on the column header. This sets internal table sorting state. Then, when supplying the contents of the table, user calls ImGui::TableGetSortSpecs() and retrieves the information about the current table sort state.

In addition to the above default behavior, I would like to have a button, located somewhere else, that would change - directly or indirectly - the sorting. Clicking on other columns' headers should retain the default ImGui sorting behavior. Is it possible?

As a quick workaround I simply sort the data according to the new criteria, but table internal state is not aware of that change. The table still "thinks" it is sorted by old column. This causes:

Upvotes: 0

Views: 696

Answers (0)

Related Questions