- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2016
05:48 PM
01-18-2016
05:48 PM
Specify a field different from the name in a grid UI
Hi,
How can I use a different name in a column UI than the table field name?
Currently we do something like:
<column name="subscriber_id"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="filter" xsi:type="string">textRange</item> <item name="label" xsi:type="string" translate="true">ID</item> </item> </argument> </column>
But, in a edit form with multiple left tabs and grids, we will run into issues because the subscriber_id will be used as a field name for filters. And that will mess up the subscriber_id passed trough the URL.
How can we add a column with a name different than the db table name?
Regards
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2016
08:03 AM
01-24-2016
08:03 AM
Re: Specify a field different from the name in a grid UI
How to set a custom name for a Magento 2 backend grid's column: https://mage2.pro/t/547
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2016
03:43 PM
01-24-2016
03:43 PM
Re: Specify a field different from the name in a grid UI
That does not work.
It won't prevent Magento from naming form fields with the value from getName() and not using the value specified in the XML.
It also won't allow multiple columns from the same field, since the last will override the later.