필터 지우기
필터 지우기

Checkbox in header row for uitable

조회 수: 7 (최근 30일)
Quy
Quy 2024년 5월 21일
댓글: Voss 2024년 5월 21일
Is it possible to put a checkbox next to a string in the same column?
I have a table, and one of the column are checkboxes. I want another checkbox that when checked will check all the other checkboxes. I know how to do this, but I what I would really like is to put this checkbox at the header row of the uitable. Maybe even add a string before the checkbox?
Is this even possible?

채택된 답변

Voss
Voss 2024년 5월 21일
It would have to be a separate uicheckbox (or uicontrol) object, separate from the uitable. You can position it to appear to be part of the uitable header.
However, it may be tricky to have it look right in all conditions. For example, if the user resizes a table column by clicking-and-dragging the line between column headers, you might like to move the checkbox accordingly, but you'll have no way to know that that column resizing is taking place while it's happening.
  댓글 수: 2
Quy
Quy 2024년 5월 21일
I figured as much. I already have the checkbox (separate from the uitable) created and working, but it would be really nice if it's inline with the header row on that same column.
Voss
Voss 2024년 5월 21일
Unfortunately, there are several uitable interactions (resizing columns as I mentioned, but also reordering columns and especially scrolling) that MATLAB doesn't give you, the programmer, sufficient information about to implement a checkbox (or whatever) that stays tied to a certain column (or to a certain place relative to the table cells, in general).

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by