Skip to content

Ui_component column sortOrder doesn't work #4620

@Bravarg

Description

@Bravarg

I creating a new adminhtml grid, and I have found a problem with setting up columns positions.

Steps to reproduce

  1. For example open the ui_component of adminhtml catalog product list Magento/Catalog/view/adminhtml/ui_component/product_listing.xml.
  2. Section "columns". Elements "column" have "sortOrder" config, which should sort columns in grid.
  3. Decrease value "sortOrder" of "name" column to 15.
    screenshot_149

Expected result

  1. The column "name" should be moved between ID and Thumbnail
    screenshot_150

Actual result

  1. Column aren't being moved.

I assume the bug is in Ui module. The file Magento/Ui/view/base/web/js/grid/listing.js contains mehtod "updatePositions" that setting up columns position by their index instead of element sortOrder. The working solution for me is replace "index" for "elem.sortOrder".
screenshot_151

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is not validGate 1 Failed. Automatic verification of issue format is failed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions