-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Table angled headers, sorting only works on first column #7937
Comments
Recording.2024-09-01.000723.mp4Here a screen recording. Not also that the whole angled header bar is highlighted when clicked, don't know if that is of relevance |
I added The reason seems to be that you have an ID conflict with your
for (int column_n = 0; column_n < columns_count; column_n++)
{
if (!TableSetColumnIndex(column_n))
continue;
// Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them)
// In your own code you may omit the PushID/PopID all-together, provided you know they won't collide.
const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n);
PushID(column_n);
TableHeader(name);
PopID();
} You are missing a I don't recall the details but I spent some time evaluating whether |
Ah, i even looked at that code and didn't see the point of Thanks! |
Why aren’t you using TableHeadersRow() ? |
Because i have a checkbox in the first column of the header for selection logic (select all/deselect all), so I have to handle drawing the header row manually. |
I am not in front of the code now but if there isn’t a column flag for that we can add one. |
If i understand you correctly, you suggest adding a column flag to put a checkbox in the header? I think a flag would not be sufficient for that, a way would be needed to set the state of the checkbox (tristate actually, also only part of the table's rows could be selected) and would need a way to report any user interaction with it. What i have now works well |
The flag would disable submitting a header. You can set call e.g. |
Actually, it already works with |
I have pushed a few comments in 722a2a1 |
Ah sorry, then i misunderstood your comment. Yes, this works beautifully, and i am of course very happy that i do not have to reimplement |
…tead of reimplementing that myself
Also #74, #96, #480, #501, #647, #654, #719, #843, #894, #1057, #1173, #1390, #1414, #1556, #1768, #2041, #2116, #2330, #2475, #2562, #2667, #2807, #2885, #3102, #3375, #3526, #3964, #4008, #4070, #4158, #4172, #4199, #4375, #4395, #4471, #4548, #4612, #4631, #4657, #4796, #5210, #5303, #5360, #5393, #5533, #5692, #5707, #5729, #5773, #5787, #5884, #6046, #6093, #6186, #6223, #6364, #6387, #6567, #6692, #6724, #6939, #6984, #7246, #7270, #7375, #7421, #7434, #7472, #7581, #7724, #7926, #7937 and probably more.. Tagging to increase visibility!
Version/Branch of Dear ImGui:
Version 1.90.9, Branch: docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Windows 11, msvc 1940
Full config/build information:
Details:
My Issue/Question:
See the below screenshot. I have a table with mixed normal and angled headers. First two normal headers, then a series of angled headers. I can sort the table on the normal header and the first angled header, but not the rest. Any click on those is just ignored. (sort specs does not become dirty). This is both when clicking on the angled header or the line below it (only the normal header row works for the first angled header column, but i understand that is expected).
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
This is not an complete minimal example, nor in C++ (its Python using imgui_bundle), but shows the main relevant code
The text was updated successfully, but these errors were encountered: