how to activate/deactivate some boxes of iutable depending on the entry in the first box
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Paul Nanfah
am 16 Jun. 2015
Bearbeitet: Paul Nanfah
am 17 Jun. 2015
hi everybody,
I have the following iutable,
is it possible to deactivate (make it uneditable) boxes A for exemple when typ is "1" and box B, C when typ is "0" by clicking on the button "set" ?
the button save :
function save_Callback(hObject, eventdata, handles) data = get(handles.uitable1, 'data'); disp(data)
since I set the boxes as editable boxes in the inspector property.
thank you
0 Kommentare
Akzeptierte Antwort
Ingrid
am 16 Jun. 2015
you can find your answer here :
3 Kommentare
Ingrid
am 17 Jun. 2015
I do not see how this code achieves what you want. You are just setting the values to zero and not making it uneditable. This can also be achieved without for loops and it is not at all clear what you are trying to achieve with the k-loop as this k is not used inside the loop. This is the correct code to do this:
function set_Callback(hObject,eventdata,handles)
data = get(handles.uitable1,'data')
idx = (data(:,1) == 0);
data(idx,2:3) =0;
data(~idx,4) = 0;
set(handles.uitbale1,'data',data);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Install Products finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!