<![CDATA[ Revo: Using MIGX to fill a table with dynamic columns and values - My Forums]]> https://forums.modx.com/thread/?thread=99025 <![CDATA[Revo: Using MIGX to fill a table with dynamic columns and values]]> https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535448
I'm not sure if this is the right place to ask this question, but if not sorry! Please let me explain what I want to do:
I've got products with subproducts that I want to show on my website (mark; showing, not selling!). For example I've got an product that has multiple options, like different diameters, weights, lengths and so on.

So I have got: Product A
Variations available:
Weight: 1kg, Length 100cm, Diameter 5cm
Weight: 2kg, Length 100cm, Diameter 5cm
Weight: 3kg, Length 100cm, Diameter 5cm

At the same time I've got Product B
Variations available
Weight: 1kg, Color: blue, Width: 15cm
Weight: 1kg, Color: red, Width: 15cm
Weight: 1kg, Color: yellow, Width: 15cm

My products have got an template called: 'Product' but I want to create dynamic columns in MIGX and reload them into an new MIGX field that enable me to fill in the specified information. So for "product A" I want to create the columns: "Weight, Length, Diameter" and for "Product B" I want to create the columns: "Weight, Color, Width". For each option I'll create an new document that needs to load the columns from the parent product. My tree looks like:

- Products
- Product A
- Subproduct 1
- Subproduct 2
- Subproduct 3
Product B
- Subproduct 1
- Subproduct 2
- Subproduct 3

For now I've created an MIGX configuration that ables me to create the column names:
[{"caption":"Info", "fields": [{"field":"column_name","caption":"Columnname"}] }]

But I'm not as strong with MIGX to have the solution to read the columns from the parent 'product'. Can anyone please help me out here? Please let me know if something isn't clear.]]>
mrsleonie25 Dec 06, 2015, 07:45 AM https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535448
<![CDATA[Re: Revo: Using MIGX to fill a table with dynamic columns and values]]> https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535618 Bruno17 Dec 09, 2015, 04:26 AM https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535618 <![CDATA[Re: Revo: Using MIGX to fill a table with dynamic columns and values]]> https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535613 I've send Bruno an PM but had no reply still. So if anyone has got an solution for me to help me out, please let me know...]]> mrsleonie25 Dec 08, 2015, 11:16 PM https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535613 <![CDATA[Re: Revo: Using MIGX to fill a table with dynamic columns and values]]> https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535531 Quote from: Bruno17 at Dec 06, 2015, 02:49 PM
does this setup help a bit?

this is the configuration for the columnscreator:
https://github.com/Bruno17/migxCustomColumns/blob/master/core/components/migxcustomcolumns/migxconfigs/migxcustomcolumns.config.js

this is the configuration for the MIGX-grid with the created columns:
https://github.com/Bruno17/migxCustomColumns/blob/master/core/components/migxcustomcolumns/migxconfigs/migxcustomcolumnsgrid.config.js

and this is the php-file, which generates the fields and columns
https://github.com/Bruno17/migxCustomColumns/blob/master/core/components/migxcustomcolumns/migxconfigs/migxcustomcolumnsgrid.config.inc.php

be sure the php-file has the same name as the config for that grid
So if you MIGX-config for your TV has the name 'migxcustomcolumnsgrid'
then the php-file needs to have the name migxcustomcolumnsgrid.config.inc.php

this is using a MIGX-TV from the same resource and needs to be modified to get the columns from your parent-resource

Is this something, you can work with?

Thanks Bruno! I'll try immediately, I'll let you know within a few minutes...]]>
mrsleonie25 Dec 07, 2015, 12:22 PM https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535531
<![CDATA[Re: Revo: Using MIGX to fill a table with dynamic columns and values]]> https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535452
this is the configuration for the columnscreator:
https://github.com/Bruno17/migxCustomColumns/blob/master/core/components/migxcustomcolumns/migxconfigs/migxcustomcolumns.config.js

this is the configuration for the MIGX-grid with the created columns:
https://github.com/Bruno17/migxCustomColumns/blob/master/core/components/migxcustomcolumns/migxconfigs/migxcustomcolumnsgrid.config.js

and this is the php-file, which generates the fields and columns
https://github.com/Bruno17/migxCustomColumns/blob/master/core/components/migxcustomcolumns/migxconfigs/migxcustomcolumnsgrid.config.inc.php

be sure the php-file has the same name as the config for that grid
So if you MIGX-config for your TV has the name 'migxcustomcolumnsgrid'
then the php-file needs to have the name migxcustomcolumnsgrid.config.inc.php

this is using a MIGX-TV from the same resource and needs to be modified to get the columns from your parent-resource

Is this something, you can work with?]]>
Bruno17 Dec 06, 2015, 08:49 AM https://forums.modx.com/thread/99025/revo-using-migx-to-fill-a-table-with-dynamic-columns-and-values#dis-post-535452