I have created custom module and show product data in grid structure using Xml in layout folder. But for dropdown attribute its show value instead of its label. How to show dropdown attribute label using xml

<block class="module\vendorname\Block\Vendors\Widget\Grid\Column" as="unit">
                      <argument name="header" xsi:type="string" translate="true">Units</argument>
                      <argument name="sortable" xsi:type="string">0</argument>
                      <argument name="index" xsi:type="string">unit</argument>
                      <argument name="header_css_class" xsi:type="string">col-units</argument>
                      <argument name="column_css_class" xsi:type="string">col-units</argument>

1 Answer 1


You can try following way (UI Component):

<column name="page_layout" component="Magento_Ui/js/grid/columns/select">
            <options class="Magento\Cms\Model\Page\Source\PageLayout"/>
            <label translate="true">Layout</label>

Check detail CMS module


Without UI component:

            'header' => __('Status'),
            'index' => 'is_active',
            'type' => 'options',
            'options' => $this->_cmsPage->getAvailableStatuses()

Check here for detail


Try another way:

<block class="Magento\Backend\Block\Widget\Grid\Column" name="integration.grid.columnSet.status" as="status">
        <argument name="header" xsi:type="string" translate="true">Status</argument>
        <argument name="type" xsi:type="string">options</argument>
        <argument name="options" xsi:type="options" model="Magento\Integration\Model\Integration\Source\Status"/>
        <argument name="index" xsi:type="string">status</argument>
        <argument name="id" xsi:type="string">status</argument>

Check here for detail

  • I have create xml file in layout folder not in ui_component. Feb 27, 2019 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.