V
V
Vadim2016-08-16 23:31:54
MODX
Vadim, 2016-08-16 23:31:54

Migx. Displaying the column names (caption) of a table?

Good afternoon. There is an MGIX TV option.
Form tabs:
[
{"caption":"Company departments","fields": [
{"field":"name_department",
"caption":"Department name"
},{
"field":"tel_department",
"caption" :"Phone"
},{
"field":"mail_department",
"caption":"E-mail"
},{
"field":"mode_department",
"caption":"Working mode"
}
]
}]
Column layout:
[
{"header": "Department name", "width": "
{"header": "E-mail", "width": "40", "sortable": "false", "dataIndex": "mail_department"},
{"header": "Mode", "width": "40", "sortable": "false", "dataIndex": "mode_department"}
]
Output like this:
$resource = $modx->getObject('modResource', 11);
$mode = $resource->getTVValue(8);
$ar = json_decode($mode, true);
print_r($ar[0]);
I get something like this:
Array ( [MIGX_id] => 1 [name_department] => test [tel_department] => 1234567 [mail_department] => [email protected] [mode_department] =>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim, 2016-08-17
@svvadim

The markup for the MIGX TV table here is the site_tmplvars table. input_properties field. From the array located there, we can get the names of the columns.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question