MIGX: Use multiple_formtabs_optionstext in Column

Hi fellas,
I have a multi formtabs configuration and I would like to show the multiple_formtabs_optionstext in my grid column. I also tried renderChunk without luck.

I am trying to achieve this:

 {
      "MIGX_id":2,
      "header":"Layout",
      "dataIndex":"multiple_formtabs_optionstext",
...
1 Like

I use a small snippet for this:

if (!isset($input)) {
	return 'use as output filter on [[+MIGX_formname:migxGetOptionName]]';
};

$migx = $modx->getService('migx', 'Migx', $modx->getOption('migx.core_path', null, $modx->getOption('core_path') . 'components/migx/') . 'model/migx/', $scriptProperties);

$config = $modx->getObject('migxConfig', array('name' => $input, 'deleted' => '0'));

$extended = json_decode($config->extended);

return $extended->multiple_formtabs_optionstext;

And call it in the renderer like this:

[[+MIGX_formname:migxGetOptionName]]

    "MIGX_id":3,
    "header":"Description",
    "dataIndex":"block_info",
    "width":150,
    "sortable":"false",
    "show_in_grid":1,
    "customrenderer":"",
    "renderer":"this.renderChunk",
    "clickaction":"",
    "selectorconfig":"",
    "renderchunktpl":"<b> [[+MIGX_formname:migxGetOptionName]]<\/b>",
    "renderoptions":"",
    "editor":""
}

Make sure that the snippet is NOT static, it some how does not work if its static

1 Like

Thank you very much, that works perfectly!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.