How can drop-down menus inside a uitable be opened with just a single mouseclick?

2 vues (au cours des 30 derniers jours)
Stefan Holleyn
Stefan Holleyn le 26 Juin 2018
Modifié(e) : Rahul le 9 Avr 2025
I have build an application using the App Designer, which is using a uitable with drop-down menus inside the columns. To open these drop-down menus I have to click twice. Once for selecing the specific cell of the table and a second time to open the drop-down list. Is there a way to prevent this and get the same result with a single mouseclick?
  6 commentaires
John Isler
John Isler le 28 Déc 2019
Thank you for this solution. It seema bit laggy. Is there another work around?
Umesh M
Umesh M le 2 Juin 2023
Hi
I am also struggling to add drop-down menu for a particular column for uitable and app designer both.
Please help.

Connectez-vous pour commenter.

Réponses (1)

Rahul
Rahul le 9 Avr 2025
Modifié(e) : Rahul le 9 Avr 2025
I understand that while trying to use dropdowns inside a UITable, the dropdown opens after clicking on the cell twice, once for selecting the cell and once for opening the dropdown. This behaviour might cause delays in your workflow.
The workaround mentioned which uses a 'CellSelectionCallback' and perform a second click on the cell by using java.awt.Robot seems to be a good workaround in this case.
However as I checked, the UITable component has been improved in the recent versions of MATLAB (i.e. R2024a onwards). Now if the dropdown arrow present in the cell is clicked directly, the the dropdown would open without the need of more number of clicks. Clicking on any other part of the cell would not open the dropdown menu and would just select the cell.
Here is an example:
The following Mathworks documentations can be referred to know more:
Thanks.

Catégories

En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by