Sorting Grid Column in magento2?Customer grid new column display when sortingCannot sorting joined column in Magento GridCustom renderered column sorting not working magento2Magento 2 UI grid non db dataprovider and pagination issueHow to display Yes/No values in admin grid (Magento2)?Customise grid collection in magento2?collection for grid in magento2Custom status label not showing on admin grid Magento2How to sort admin grid filter elements in Magento 2?Use join table to display data in admin grid column

Reusing studs to hang shoe bins

What is the meaning of “these lederhosen are riding up my Bundesliga”?

Is the internet in Madagascar faster than in UK?

Notice period 60 days but I need to join in 45 days

Unlock your Lock

Is it ok to record the 'environment' around my workplace?

What is this fighter jet at Weymouth NAS?

Is a memoized pure function itself considered pure?

How were medieval castles built in swamps or marshes without draining them?

Why error propagation in CBC mode encryption affect two blocks?

How to say "I only speak one which is English." in French?

Expressing an implication as ILP where each implication term comprises a chain of boolean ORs

3D cryptic featuring Mao, Stalin and Simba's uncle

How much does Commander Data weigh?

How to check whether a sublist exist in a huge database lists in a fast way?

Is this password scheme legit?

Router on a stick not connecting 2 different VLANs

What stops you from using fixed income in developing countries?

Can I renew my USA passport book and passport card separately?

Shift lens vs move body?

How to use properly "sich selbst"

Hangman game in Python - need feedback on the quality of code

Why is adding AC power easier than adding DC power?

What are the IPSE’s, the ASPE’s, the FRIPSE’s and the GRIPSE’s?



Sorting Grid Column in magento2?


Customer grid new column display when sortingCannot sorting joined column in Magento GridCustom renderered column sorting not working magento2Magento 2 UI grid non db dataprovider and pagination issueHow to display Yes/No values in admin grid (Magento2)?Customise grid collection in magento2?collection for grid in magento2Custom status label not showing on admin grid Magento2How to sort admin grid filter elements in Magento 2?Use join table to display data in admin grid column






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have created a ui component grid .



How to sorting the admin grid



<?xml version="1.0"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
<item name="deps" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
</item>
<item name="spinner" xsi:type="string">xx_stockmovements_stock_columns</item>
</argument>
<dataSource name="xx_stockmovements_stock_movements_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">XxStockMovementsGridDataProvider</argument>
<argument name="name" xsi:type="string">xx_stockmovements_stock_movements_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">xx_stockmovements_stock_movements</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<exportButton name="export_button">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.ids</item>
</item>
</argument>
</exportButton>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
</filters>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.ids</item>
</item>
</argument>
</paging>
</container>
<columns name="xx_stockmovements_stock_columns">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">$ $.$data.rowIndex </item>
<item name="1" xsi:type="boolean">true</item>
</item>
</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="root" xsi:type="string">columns.$ $.index </item>
<item name="namespace" xsi:type="string">current.$ $.storageConfig.root</item>
</item>
</item>
</item>
</argument>
<column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Sku</item>
<item name="sorting" xsi:type="string">desc</item>
<!--<item name="sortable" xsi:type="boolean">true</item>-->
</item>
</argument>
</column>
<column name="qty">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Qty</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="movement">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Movement</item>
<item name="sortable" xsi:type="boolean">false</item>
</item>
</argument>
</column>
<column name="is_in_stock">
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">XxStockMovementsModelColumnInStock</item>
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">select</item>
<item name="label" translate="true" xsi:type="string">In Stock</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
<item name="dataType" xsi:type="string">select</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="message">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Message</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
<settings>
<filter>textRange</filter>
<label translate="true">Message</label>
<sorting>asc</sorting>
</settings>
</column>

<column name="user">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">User</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
</columns>
</listing>


I also trying



<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>


But its not working










share|improve this question


























  • Can you please upload your xml code of ui grid?

    – Rohan Hapani
    Mar 28 '18 at 12:59

















0















I have created a ui component grid .



How to sorting the admin grid



<?xml version="1.0"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
<item name="deps" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
</item>
<item name="spinner" xsi:type="string">xx_stockmovements_stock_columns</item>
</argument>
<dataSource name="xx_stockmovements_stock_movements_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">XxStockMovementsGridDataProvider</argument>
<argument name="name" xsi:type="string">xx_stockmovements_stock_movements_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">xx_stockmovements_stock_movements</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<exportButton name="export_button">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.ids</item>
</item>
</argument>
</exportButton>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
</filters>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.ids</item>
</item>
</argument>
</paging>
</container>
<columns name="xx_stockmovements_stock_columns">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">$ $.$data.rowIndex </item>
<item name="1" xsi:type="boolean">true</item>
</item>
</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="root" xsi:type="string">columns.$ $.index </item>
<item name="namespace" xsi:type="string">current.$ $.storageConfig.root</item>
</item>
</item>
</item>
</argument>
<column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Sku</item>
<item name="sorting" xsi:type="string">desc</item>
<!--<item name="sortable" xsi:type="boolean">true</item>-->
</item>
</argument>
</column>
<column name="qty">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Qty</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="movement">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Movement</item>
<item name="sortable" xsi:type="boolean">false</item>
</item>
</argument>
</column>
<column name="is_in_stock">
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">XxStockMovementsModelColumnInStock</item>
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">select</item>
<item name="label" translate="true" xsi:type="string">In Stock</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
<item name="dataType" xsi:type="string">select</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="message">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Message</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
<settings>
<filter>textRange</filter>
<label translate="true">Message</label>
<sorting>asc</sorting>
</settings>
</column>

<column name="user">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">User</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
</columns>
</listing>


I also trying



<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>


But its not working










share|improve this question


























  • Can you please upload your xml code of ui grid?

    – Rohan Hapani
    Mar 28 '18 at 12:59













0












0








0








I have created a ui component grid .



How to sorting the admin grid



<?xml version="1.0"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
<item name="deps" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
</item>
<item name="spinner" xsi:type="string">xx_stockmovements_stock_columns</item>
</argument>
<dataSource name="xx_stockmovements_stock_movements_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">XxStockMovementsGridDataProvider</argument>
<argument name="name" xsi:type="string">xx_stockmovements_stock_movements_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">xx_stockmovements_stock_movements</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<exportButton name="export_button">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.ids</item>
</item>
</argument>
</exportButton>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
</filters>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.ids</item>
</item>
</argument>
</paging>
</container>
<columns name="xx_stockmovements_stock_columns">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">$ $.$data.rowIndex </item>
<item name="1" xsi:type="boolean">true</item>
</item>
</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="root" xsi:type="string">columns.$ $.index </item>
<item name="namespace" xsi:type="string">current.$ $.storageConfig.root</item>
</item>
</item>
</item>
</argument>
<column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Sku</item>
<item name="sorting" xsi:type="string">desc</item>
<!--<item name="sortable" xsi:type="boolean">true</item>-->
</item>
</argument>
</column>
<column name="qty">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Qty</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="movement">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Movement</item>
<item name="sortable" xsi:type="boolean">false</item>
</item>
</argument>
</column>
<column name="is_in_stock">
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">XxStockMovementsModelColumnInStock</item>
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">select</item>
<item name="label" translate="true" xsi:type="string">In Stock</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
<item name="dataType" xsi:type="string">select</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="message">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Message</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
<settings>
<filter>textRange</filter>
<label translate="true">Message</label>
<sorting>asc</sorting>
</settings>
</column>

<column name="user">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">User</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
</columns>
</listing>


I also trying



<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>


But its not working










share|improve this question
















I have created a ui component grid .



How to sorting the admin grid



<?xml version="1.0"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
<item name="deps" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements_data_source</item>
</item>
<item name="spinner" xsi:type="string">xx_stockmovements_stock_columns</item>
</argument>
<dataSource name="xx_stockmovements_stock_movements_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">XxStockMovementsGridDataProvider</argument>
<argument name="name" xsi:type="string">xx_stockmovements_stock_movements_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">xx_stockmovements_stock_movements</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<exportButton name="export_button">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.ids</item>
</item>
</argument>
</exportButton>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
</filters>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns.ids</item>
</item>
</argument>
</paging>
</container>
<columns name="xx_stockmovements_stock_columns">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.xx_stockmovements_stock_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">$ $.$data.rowIndex </item>
<item name="1" xsi:type="boolean">true</item>
</item>
</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">xx_stockmovements_stock_movements.xx_stockmovements_stock_movements.listing_top.bookmarks</item>
<item name="root" xsi:type="string">columns.$ $.index </item>
<item name="namespace" xsi:type="string">current.$ $.storageConfig.root</item>
</item>
</item>
</item>
</argument>
<column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Sku</item>
<item name="sorting" xsi:type="string">desc</item>
<!--<item name="sortable" xsi:type="boolean">true</item>-->
</item>
</argument>
</column>
<column name="qty">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Qty</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="movement">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Movement</item>
<item name="sortable" xsi:type="boolean">false</item>
</item>
</argument>
</column>
<column name="is_in_stock">
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">XxStockMovementsModelColumnInStock</item>
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">select</item>
<item name="label" translate="true" xsi:type="string">In Stock</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
<item name="dataType" xsi:type="string">select</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="message">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Message</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
<settings>
<filter>textRange</filter>
<label translate="true">Message</label>
<sorting>asc</sorting>
</settings>
</column>

<column name="user">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">User</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">dateRange</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
<item name="dataType" xsi:type="string">date</item>
<item name="label" xsi:type="string" translate="true">Created At</item>
<item name="sortable" xsi:type="string">asc</item>
</item>
</argument>
</column>
</columns>
</listing>


I also trying



<item name="sorting" xsi:type="string">desc</item>
<item name="sortable" xsi:type="boolean">true</item>


But its not working







magento2.2 grid php-7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 '18 at 13:22







Mano M

















asked Mar 28 '18 at 12:48









Mano MMano M

1,1804 silver badges26 bronze badges




1,1804 silver badges26 bronze badges















  • Can you please upload your xml code of ui grid?

    – Rohan Hapani
    Mar 28 '18 at 12:59

















  • Can you please upload your xml code of ui grid?

    – Rohan Hapani
    Mar 28 '18 at 12:59
















Can you please upload your xml code of ui grid?

– Rohan Hapani
Mar 28 '18 at 12:59





Can you please upload your xml code of ui grid?

– Rohan Hapani
Mar 28 '18 at 12:59










3 Answers
3






active

oldest

votes


















0















Have You tried Like below code in Ui_component form file



<item name="sortOrder" xsi:type="number">10</item>





share|improve this answer
































    0
















    Try Below code




    <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
    <argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
    <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
    <item name="filter" xsi:type="string">text</item>
    <item name="label" xsi:type="string" translate="true">Sku</item>
    <item name="sorting" xsi:type="string">desc</item>
    <item name="sortable" xsi:type="boolean">true</item>
    <item name="sortOrder" xsi:type="number">1</item>
    </item>
    </argument>
    </column>


    Remove Cache



    php bin/magento cache:clean
    php bin/magento cache:flush


    Hope it Helps.






    share|improve this answer
































      0















      I had exactly the same problem.



      You first have to do your columns like this:



      <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
      <item name="filter" xsi:type="string">text</item>
      <item name="label" xsi:type="string" translate="true">Sku</item>
      <item name="sorting" xsi:type="string">desc</item>
      <item name="sortable" xsi:type="boolean">true</item>
      <item name="sortOrder" xsi:type="number">1</item>
      </item>
      </argument>
      </column>


      Thereafter you need to go to your database table. search for table :




      ui_bookmark




      search for the column that relates to your grid i.e



      product_attributes_listing


      delete the column and then :



      php bin/magento cache:clean
      php bin/magento cache:flush





      share|improve this answer



























        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "479"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: false,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f220202%2fsorting-grid-column-in-magento2%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0















        Have You tried Like below code in Ui_component form file



        <item name="sortOrder" xsi:type="number">10</item>





        share|improve this answer





























          0















          Have You tried Like below code in Ui_component form file



          <item name="sortOrder" xsi:type="number">10</item>





          share|improve this answer



























            0














            0










            0









            Have You tried Like below code in Ui_component form file



            <item name="sortOrder" xsi:type="number">10</item>





            share|improve this answer













            Have You tried Like below code in Ui_component form file



            <item name="sortOrder" xsi:type="number">10</item>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 28 '18 at 12:59









            Learing_CoderLearing_Coder

            6693 silver badges19 bronze badges




            6693 silver badges19 bronze badges


























                0
















                Try Below code




                <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                <item name="filter" xsi:type="string">text</item>
                <item name="label" xsi:type="string" translate="true">Sku</item>
                <item name="sorting" xsi:type="string">desc</item>
                <item name="sortable" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">1</item>
                </item>
                </argument>
                </column>


                Remove Cache



                php bin/magento cache:clean
                php bin/magento cache:flush


                Hope it Helps.






                share|improve this answer





























                  0
















                  Try Below code




                  <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                  <argument name="data" xsi:type="array">
                  <item name="config" xsi:type="array">
                  <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                  <item name="filter" xsi:type="string">text</item>
                  <item name="label" xsi:type="string" translate="true">Sku</item>
                  <item name="sorting" xsi:type="string">desc</item>
                  <item name="sortable" xsi:type="boolean">true</item>
                  <item name="sortOrder" xsi:type="number">1</item>
                  </item>
                  </argument>
                  </column>


                  Remove Cache



                  php bin/magento cache:clean
                  php bin/magento cache:flush


                  Hope it Helps.






                  share|improve this answer



























                    0














                    0










                    0










                    Try Below code




                    <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                    <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                    <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Sku</item>
                    <item name="sorting" xsi:type="string">desc</item>
                    <item name="sortable" xsi:type="boolean">true</item>
                    <item name="sortOrder" xsi:type="number">1</item>
                    </item>
                    </argument>
                    </column>


                    Remove Cache



                    php bin/magento cache:clean
                    php bin/magento cache:flush


                    Hope it Helps.






                    share|improve this answer














                    Try Below code




                    <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                    <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                    <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Sku</item>
                    <item name="sorting" xsi:type="string">desc</item>
                    <item name="sortable" xsi:type="boolean">true</item>
                    <item name="sortOrder" xsi:type="number">1</item>
                    </item>
                    </argument>
                    </column>


                    Remove Cache



                    php bin/magento cache:clean
                    php bin/magento cache:flush


                    Hope it Helps.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 24 at 9:49









                    Mohit RaneMohit Rane

                    1,32618 bronze badges




                    1,32618 bronze badges
























                        0















                        I had exactly the same problem.



                        You first have to do your columns like this:



                        <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                        <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                        <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                        <item name="filter" xsi:type="string">text</item>
                        <item name="label" xsi:type="string" translate="true">Sku</item>
                        <item name="sorting" xsi:type="string">desc</item>
                        <item name="sortable" xsi:type="boolean">true</item>
                        <item name="sortOrder" xsi:type="number">1</item>
                        </item>
                        </argument>
                        </column>


                        Thereafter you need to go to your database table. search for table :




                        ui_bookmark




                        search for the column that relates to your grid i.e



                        product_attributes_listing


                        delete the column and then :



                        php bin/magento cache:clean
                        php bin/magento cache:flush





                        share|improve this answer





























                          0















                          I had exactly the same problem.



                          You first have to do your columns like this:



                          <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                          <argument name="data" xsi:type="array">
                          <item name="config" xsi:type="array">
                          <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                          <item name="filter" xsi:type="string">text</item>
                          <item name="label" xsi:type="string" translate="true">Sku</item>
                          <item name="sorting" xsi:type="string">desc</item>
                          <item name="sortable" xsi:type="boolean">true</item>
                          <item name="sortOrder" xsi:type="number">1</item>
                          </item>
                          </argument>
                          </column>


                          Thereafter you need to go to your database table. search for table :




                          ui_bookmark




                          search for the column that relates to your grid i.e



                          product_attributes_listing


                          delete the column and then :



                          php bin/magento cache:clean
                          php bin/magento cache:flush





                          share|improve this answer



























                            0














                            0










                            0









                            I had exactly the same problem.



                            You first have to do your columns like this:



                            <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                            <argument name="data" xsi:type="array">
                            <item name="config" xsi:type="array">
                            <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                            <item name="filter" xsi:type="string">text</item>
                            <item name="label" xsi:type="string" translate="true">Sku</item>
                            <item name="sorting" xsi:type="string">desc</item>
                            <item name="sortable" xsi:type="boolean">true</item>
                            <item name="sortOrder" xsi:type="number">1</item>
                            </item>
                            </argument>
                            </column>


                            Thereafter you need to go to your database table. search for table :




                            ui_bookmark




                            search for the column that relates to your grid i.e



                            product_attributes_listing


                            delete the column and then :



                            php bin/magento cache:clean
                            php bin/magento cache:flush





                            share|improve this answer













                            I had exactly the same problem.



                            You first have to do your columns like this:



                            <column name="product_sku" class="XxStockMovementsUiComponentListingColumnsProduct">
                            <argument name="data" xsi:type="array">
                            <item name="config" xsi:type="array">
                            <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                            <item name="filter" xsi:type="string">text</item>
                            <item name="label" xsi:type="string" translate="true">Sku</item>
                            <item name="sorting" xsi:type="string">desc</item>
                            <item name="sortable" xsi:type="boolean">true</item>
                            <item name="sortOrder" xsi:type="number">1</item>
                            </item>
                            </argument>
                            </column>


                            Thereafter you need to go to your database table. search for table :




                            ui_bookmark




                            search for the column that relates to your grid i.e



                            product_attributes_listing


                            delete the column and then :



                            php bin/magento cache:clean
                            php bin/magento cache:flush






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 14 at 13:15









                            theSeekertheSeeker

                            1218 bronze badges




                            1218 bronze badges






























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Magento Stack Exchange!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f220202%2fsorting-grid-column-in-magento2%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                                Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                                Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?