Need a row-specifi or cell-specific context menu for uitable
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I need to assign a row-specific or a column specific context menu for a uitable (within uifigure).
I know how to create a global context menu, but I need it to be different for every row (or cell) of the table.
Tricks with learning cursor position won't work, as the table is larger, than it is shown on the screen and I use sliders to navigate through it.
The Matlab version is 2020a.
0 Kommentare
Antworten (1)
Divyanshu
am 24 Sep. 2024
Bearbeitet: Divyanshu
am 24 Sep. 2024
A possible way to achieve location specific context-menu opening through App designer is adding the following piece of code inside the callback function defined for 'ContextMenuOpeningFcn' property of 'uicontextmenu()':
row = event.InteractionInformation.Row;
col = event.InteractionInformation.Column;
app.currentRow = row;
app.currentColumn = col;
% The above piece of code enables you to track the row and column of a UITable which user
% has clicked or from which the context-menu is triggered.
I have used this code for version R2023b, there it works well but not sure if it will work for earlier versions of MATLAB.
Hope this helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!