problem to change color after dropdown menu
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
hi, i use dropdown menu in app designer to change value in table .
C is matrix with rows and columns to be highlighted in yellow
but the previous colors remain
function DateSearchDropDown_5Clicked(app, event)
item = event.InteractionInformation.Item;
if ~isempty(item)
[app.UITable_CorrelationTab.Data,c]=Table_Correlazione_Struct(app.Eq,app.Preset,app.DateSearchDropDown_5.Value);
s = uistyle('BackgroundColor','yellow');
addStyle(app.UITable_CorrelationTab,s,'cell',c);
end
end
I think you have to restore the original colors and then color the new matrix
How can do it?
0 Kommentare
Akzeptierte Antwort
Voss
am 5 Aug. 2023
Bearbeitet: Voss
am 5 Aug. 2023
If that's the only uistyle you use on the table, then calling removeStyle to remove all uistyles before adding the new one should work:
function DateSearchDropDown_5Clicked(app, event)
removeStyle(app.UITable_CorrelationTab);
item = event.InteractionInformation.Item;
if ~isempty(item)
[app.UITable_CorrelationTab.Data,c]=Table_Correlazione_Struct(app.Eq,app.Preset,app.DateSearchDropDown_5.Value);
s = uistyle('BackgroundColor','yellow');
addStyle(app.UITable_CorrelationTab,s,'cell',c);
end
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Exploration 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!