![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1244302/image.png)
How can I create rows in UITable APP Designer with categoricals and have the user add rows as necessary?
3 ビュー (過去 30 日間)
古いコメントを表示
I am developing an app where the user should be able to select from a dropdown within a table and also add rows to the table as more data is required. The user will select if the data is a force, moment, material property, etc. from a dropdown then input the value (editable entry). So far I have been able to create the table but cannot seem to input rows with the correct data types and dynamically add/remove rows.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1241722/image.png)
0 件のコメント
回答 (1 件)
Nikhilesh
2022 年 12 月 27 日
You can create an editable column and use 'categorical' function to add dropdown list as per your requirement.
Kindly follow this MATLAB answer for a similar example where a dropdown is created using 'categorical' function.
For the second part you can create correcsponding edit fields from the component library and append the data to the table.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1244302/image.png)
function UpdateButtonPushed(app, event)
app.Data=app.UITable.Data;
app.Data=[app.Data;{app.PropertyEditField.Value,app.timeEditField.Value,app.DropDown.Value,1,1}]
app.UITable.Data=app.Data;
app.UITable.ColumnEditable=true;
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!