フィルターのクリア

How can I go to the next cell in an UITable in app designer by pressing "intro" or "tab"?

11 ビュー (過去 30 日間)
Edwin Henry Jara Bardales
Edwin Henry Jara Bardales 2022 年 10 月 21 日
編集済み: Jonas 2023 年 10 月 26 日
I am using tables in app designer, but I want to write values into the cell and then i want to press "intro" to jump to the next cell, but it is not possible, so I have to click there in the next cell, which is impractical.
Someone here knows how to program that maybe in an event?
  5 件のコメント
Matt
Matt 2023 年 10 月 25 日
Hi,
I know this is an old question but i'm curious if this is still the case, it would be great to be able to change the focus using tab/enter (or shift tab/enter) as familiar with moving through cells in Excel. Would definitely be a nice feature to have.
Jonas
Jonas 2023 年 10 月 26 日
編集済み: Jonas 2023 年 10 月 26 日
hey @Matt,
I just had a short look into that and i managed to make the possible to navigate using tab, return or with the modifier shift. however it is not possible to (vusially) move the selection back to the first cell you clicked on. I does not highlight, although the position is set correctly.
I do not know why, but all other cells work.
close all hidden;
fig=uifigure;
tableSize=[4,4];
tbl=uitable(fig,'Data',num2cell(rand(tableSize)),'ColumnEditable',[false true true true]);
tbl.KeyPressFcn={@handleButtons,tableSize};
function handleButtons(src,evt,maxSize)
if isequal(evt.Modifier,{'shift'})
direction=-1;
else
direction=1;
end
if strcmp(evt.Key,'tab')
newPos=src.Selection+[0 direction];
elseif strcmp(evt.Key,'return')
newPos=src.Selection+[direction 0];
else
newPos=src.Selection;
end
% prevent over- and undershoot
newPos=min([newPos;maxSize]);
newPos=max([newPos;[1 1]]);
src.Selection=newPos;
drawnow;
end
at the edges of the table, the tab will lead to a unselection of the table, tabbing again will set the focus on the table again. enter at the lower edge of the table will lead to the edit mode.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by