by mongonv » Thu Jul 26, 2012 11:50 am
The 3 and 6 issue is relatively easy and can be handled in a number of ways. A couple ways right off that it can be handled are:
1) Use a tabset with hidden headers and switch the active index when a radio button is clicked
2) Have a component file for each layout and load the applicable component file using the load or loadandcache methods when the radio is selected.
The dynamic adding of matrix columns is a lot more complex but completely doable. To add a new column you have to create a new matrix.column object, set its properties, and then either use the matrix adoptchild or insertbefore methods to add the column to the matrix.
If you are using it to edit or some other editmask functionality, you will need to add the create that type of component and attach it to the matrix.column object.
Adding columns dynamically can get very tricky depending on how much you are trying to do with the column. I personally have tried to design the user interface around not having to mess with adding new columns, so have not actually written any code to add columns, just know it can be done.
If you search the forum and learning center there may be an example somewhere of how to dynamically add columns.
Hope that helps,
Ed