Table persistence question.
Version/Branch of Dear ImGui:
imgui branch: docking, version: 1.92.2b (19222)
Back-ends:
imgui_impl_opengl3 + imgui_impl_sdl2 (2.30.9, 2.30.9)
Compiler, OS:
MSVC / GCC
Full config/build information:
No response
Details:
We are heavy users of ImGui persistence (windows/layout/docking/etc.), and for the most part it's been working fine for years now (some expected difficulties with multi-display etc. aside).
But there is one part of table persistence which is not working well for us, and I have no idea how to get ImGui's built-in persistence to play nice.
The scenario is this: most of our table use static layout and almost never change, or the layout is not persisted, but in some cases the layout is very important to users and they spend a lot of time tweaking hidden columns, column order, and sorting.
Some of these tables have over a hundred code-defined columns, but then also any number of additional user-defined (dynamic) columns.
But because ImGui internally persistence keys on column indexes, we have real trouble adding coded columns and/or adding/removing user-defined columns without messing up internal Imgui config.
(currently we do quick checksum, and if it changes from a previous one we hard-reset it... but this happens often and is a pain)
We could write our own persistence for tables, but I really don't want to do this and maintain it (as currently this may need to be done in ImGui codebase, there are not override hooks afaik)
This would all be solved if ImGui switches to be keyed off either a key based on the hash of the column name, or possibly a provided ImGuiID passed from us.
I understand that this would break existing persistence, but perhaps ImGui can expose a callback with tables where the caller can provide the index/id, otherwise it would revert to using the index?
Screenshots/Video:
No response