Closed minh0722 closed 7 months ago
Hello,
I don't think your issue has anything to do with nested tables.
if (ImGui::Selectable(decimalStringToDisplay(callOptionEntry.m_openInterest).c_str(), false,
You are passing selected = false
to your selectable aka specifying that it is always unselected.
You are supposed to maintain your selection state somehow, e.g. store the current selection index.
When submitting repro code, always try to narrow it down to the minimum amount of possible code that other people can compile (aka remove any extraneous code, and remove external dependency by e.g. replacing them with hardcoded values), and by the time you have done this you are likely to have solved your issue.
Thanks for the answer, will do better next time!
Version/Branch of Dear ImGui:
Version 1.90.1, Branch: master
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler, OS:
Windows 10 + MSVC 2022
Full config/build information:
Details:
My Issue/Question: How to get selectable to work on a nested table?
I have a table with 2 columns, with the first column containing another table (with call/put options), and the other column contains navigation buttons. Below it the string where I marked in red rectangle specifies whether user clicks on call or put options. By default it says None if nothing has been clicked yet. I'm using nested table and selectable in the standard way in the demo, but selectable doesn't seem to work in nested table.
Screenshots/Video:
Minimal, Complete and Verifiable Example code: