필터 지우기
필터 지우기

How to run CellEditCallback when setting Data for a uitable

조회 수: 18 (최근 30일)
Jeff Waldron
Jeff Waldron 2017년 5월 17일
답변: Sanket Karnik 2017년 5월 26일
I've looked at many sources, but cannot find a workaround to this problem... I know CellEditCallback gets called after editing a uitable's Data... but is there any way to have it run when Set(uitable,'Data',x)? It seems if one wants to continuously update the Data, there is no way to trigger any callbacks to perform validation or other things...

답변 (1개)

Sanket Karnik
Sanket Karnik 2017년 5월 26일
I understand that you want to have a callback function while calling 'set' method on uitable. The 'CellEditCallback' is call if any specific cell is edited but since you are changing entire data set while calling 'set' command the callback function is not called. As a simple workaround you can create a new function called 'setandvalidate' in this function you can call 'set' command and after that you can call the 'validate' function which you wanted to use for validation. Now instead of calling 'set' function everywhere if you call 'setandvalidate' function to set the uitable data it will do validation every time you try to set the data.

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by