Double click callback on a cell in uitable without Java?

10 visualizaciones (últimos 30 días)
Song
Song el 7 de Sept. de 2015
Editada: Stefanie Schwarz el 2 de Oct. de 2020
After google-ing for a while, I cannot find a feasible solution to realize the double click callback on a cell in uitable.
Does anyone have a better idea or workaround for this? without java or findjobj.

Respuestas (1)

Walter Roberson
Walter Roberson el 7 de Sept. de 2015
How about CellSelectionCallback and test the figure SelectionType property for 'open' ?
  2 comentarios
Song
Song el 8 de Sept. de 2015
Try following codes:
function test()
f = figure('Position',[200 200 400 150]);
dat = rand(3);
cnames = {'X-Data','Y-Data','Z-Data'};
rnames = {'First','Second','Third'};
t = uitable('Parent',f,'Data',dat,'ColumnName',cnames,...
'CellSelectionCallback', @cbk, ...
'RowName',rnames,'Position',[20 20 360 100]);
function cbk(~, ~)
ty = get(f, 'SelectionType')
end
end
You'll see only normal comes out from the selectiontype.
Stefanie Schwarz
Stefanie Schwarz el 2 de Oct. de 2020
Editada: Stefanie Schwarz el 2 de Oct. de 2020
In R2020a and ealier, 'SelectionType' was not honorored by UItables; starting from R2020b, the above solution should work.

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by