1

Have listing but need to change view of one column:

    <column name="status">
        <settings>
            <filter>text</filter>
            <label translate="true">Status</label>
        </settings>
    </column>

i need to display text as value instead of integer value since in database it has 0 or 1 so in overview i have numerical values.

also another question how to change sorting order of columns since it seem i have actions column in front of some other fields although in xml it's placed as last item

  • Check this for int value to text : magento.stackexchange.com/questions/120606/… – Vivek May 6 at 9:14
  • 1
    thx, this solved my view problem, now need to change sorting – Naberd Zendi May 6 at 9:27
  • Glad to hear this. So You wanted to sort fields ? In grid listing ? – Vivek May 6 at 9:45
  • yes, in grid listing i need to sort available fields. used mage2gen site to create base structure for my module. – Naberd Zendi May 6 at 10:12
  • Try this. <item name="sortOrder" xsi:type="number">6</item> – Vivek May 6 at 10:25
1

To change int value to text you can use below code :

<column name="yourcolumn" class="Vendor\Modulename\Ui\Component\Listing\Column\Yourcolumn">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">false</item>
            <item name="label" xsi:type="string" translate="true">Column Label</item>
        </item>
    </argument>
</column>

Ref : https://magento.stackexchange.com/a/171412/49826

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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