Problem with data uitable
Show older comments
Hello everyone! I would like to ask a question about a program using a GUI in which when clicking on a pushbotom a table with the following characteristics is created:
Columns: Building 1, Building 2 ... (depending on the number of buildings you need) Rows: Fixed will have the height of each building, the height property, and the number of walls (each building can have the walls that are needed)
It is a program that designs a scenario for which I have a pushbotom to draw it (here there is no problem).
When I press the pushbotton to create the table with the properties of buildings, I see the table filled with zeros with the number of rows and columns corresponding, where I can edit in every building all possible walls.
An example: If I have two buildings, I get the table with two columns, one for each building. Regarding the rows, if for example building 1 has 4 walls, and building 2 has 6 walls, the number of rows in the table will correspond to the building with the largest number of walls (building 2) and two rows Which will always have all the buildings as I mentioned above corresponding to the height and property.
For building 1 then we will have 2 (height and property) + 4 (walls), 6 editable rows and 2 non-editable rows. For building 2 then we will have 2 (height and property) + 6 (walls), 8 editable rows and 0 not editable.
The problem comes when once I have edited the table, I put another building and push the pushbotton again where I get the perfect table with the number of rows and columns editable, and all these are back to 0 and I would like to be Keep the values I had when I first edit the properties table, but with the option to be able to edit them in case the second time I want to change some value.
3 Comments
Tushar Upadhyay
on 16 Jun 2017
Are you using App Designer or GUIDE to create UI?
Please provide sample reproduction code.
One thing you may try is that in the callback function of a push button, get the data inserted in the uitable and save it to some variable.
While reloading the uitable, assign the data of the uitable from the variable which you saved in the callback function of a push button.
Lorenzo Villafranca
on 21 Jun 2017
Geoff Hayes
on 22 Jun 2017
Lorenzo - what is your code for the push button that puts another building in your table? Please copy and paste the function here so that we can provide an idea of what to do next.
Answers (0)
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!