Magento 2: How do I hide a column from an admin grid? The Next CEO of Stack OverflowMagento2 Add css class to admin ui grid columnMagento 2 custom grid column sort orderMagento2 Add css class to admin ui grid columnAdd custom column to customer admin gridRemove selectionsColumn from Columns dropdown in admin gridMagento 2 admin customer grid export to csv with custom fieldsMagento 2 : Change Admin grid column widthGrid column not showing in admin grid on Magento 2How to add custom column in admin grid which are not in database using ui compont in magento2?Magento2 how to set default columns in admin gridHow to set default sort order for custom listing uicomponent to use multiple columns

Audio Conversion With ADS1243

(How) Could a medieval fantasy world survive a magic-induced "nuclear winter"?

Calculate the Mean mean of two numbers

Vector calculus integration identity problem

Help! I cannot understand this game’s notations!

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Yu-Gi-Oh cards in Python 3

Why did early computer designers eschew integers?

TikZ: How to fill area with a special pattern?

Computationally populating tables with probability data

Is fine stranded wire ok for main supply line?

Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico

Players Circumventing the limitations of Wish

What was Carter Burke's job for "the company" in Aliens?

Inductor and Capacitor in Parallel

"Eavesdropping" vs "Listen in on"

Is there a reasonable and studied concept of reduction between regular languages?

What would be the main consequences for a country leaving the WTO?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

What flight has the highest ratio of timezone difference to flight time?

How do you define an element with an ID attribute using LWC?

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

How to Implement Deterministic Encryption Safely in .NET

Getting Stale Gas Out of a Gas Tank w/out Dropping the Tank



Magento 2: How do I hide a column from an admin grid?



The Next CEO of Stack OverflowMagento2 Add css class to admin ui grid columnMagento 2 custom grid column sort orderMagento2 Add css class to admin ui grid columnAdd custom column to customer admin gridRemove selectionsColumn from Columns dropdown in admin gridMagento 2 admin customer grid export to csv with custom fieldsMagento 2 : Change Admin grid column widthGrid column not showing in admin grid on Magento 2How to add custom column in admin grid which are not in database using ui compont in magento2?Magento2 how to set default columns in admin gridHow to set default sort order for custom listing uicomponent to use multiple columns










8















Using 2.1.3, is there a way to hide an entire column from a UI component admin grid? I found Magento2 Add css class to admin ui grid column, and that hides the column, but not the column header (misaligning the grid columns).










share|improve this question




























    8















    Using 2.1.3, is there a way to hide an entire column from a UI component admin grid? I found Magento2 Add css class to admin ui grid column, and that hides the column, but not the column header (misaligning the grid columns).










    share|improve this question


























      8












      8








      8








      Using 2.1.3, is there a way to hide an entire column from a UI component admin grid? I found Magento2 Add css class to admin ui grid column, and that hides the column, but not the column header (misaligning the grid columns).










      share|improve this question
















      Using 2.1.3, is there a way to hide an entire column from a UI component admin grid? I found Magento2 Add css class to admin ui grid column, and that hides the column, but not the column header (misaligning the grid columns).







      magento2 admin grid uicomponent






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:55









      Community

      1




      1










      asked Feb 7 '17 at 15:06









      dbcndbcn

      409313




      409313




















          3 Answers
          3






          active

          oldest

          votes


















          3














          You can try with <item name="componentDisabled" xsi:type="boolean">true</item>



          For example:



          Vendor/Module/view/adminhtml/ui_component/product_form.xml



          <field name="backorders">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="componentDisabled" xsi:type="boolean">true</item>
          </item>
          </argument>
          </field>





          share|improve this answer

























          • Thanks @Khoa, but I want to display the column depending on the user's permissions, so I want the column there, but to start hidden.

            – dbcn
            Feb 7 '17 at 16:41


















          2














          use <item name="visible" xsi:type="boolean">false</item>
          in the config node of data argument when declaring column



          eg.



          <column name="created_at">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="resizeEnabled" xsi:type="boolean">false</item>
          <item name="filter" xsi:type="string">dateRange</item>
          <item name="sorting" xsi:type="string">desc</item>
          <item name="label" xsi:type="string" translate="true">Created at</item>
          <item name="sortOrder" xsi:type="number">120</item>
          <item name="visible" xsi:type="boolean">false</item>
          </item>
          </argument>
          </column>


          the only issue that the filter won't showing until you switch the column back to visible






          share|improve this answer

























          • Thanks @Mammouth, but this looks like a config setting - I want to be able to change the visibility based on the users role, so it would have to check it in code.

            – dbcn
            Jun 16 '17 at 17:18











          • acl wasn't created for this ... but for mimic something similar just extend/override Magento_Ui/view/base/web/js/grid/columns/column.js with your business logic

            – Mammouth
            Jun 20 '17 at 10:33











          • otehrwise I think would be good to open a new thread to your current problem (hiding column by user role settings), because this one already solved

            – Mammouth
            Jun 20 '17 at 10:43


















          0














          Add below code in your ui xml to remove columns



          <column name="name_of_column">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="componentDisabled" xsi:type="boolean">true</item>
          </item>
          </argument>
          </column>
          <field name="name_of_column">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="componentDisabled" xsi:type="boolean">true</item>
          </item>
          </argument>
          </field>





          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%2f158596%2fmagento-2-how-do-i-hide-a-column-from-an-admin-grid%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









            3














            You can try with <item name="componentDisabled" xsi:type="boolean">true</item>



            For example:



            Vendor/Module/view/adminhtml/ui_component/product_form.xml



            <field name="backorders">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
            </argument>
            </field>





            share|improve this answer

























            • Thanks @Khoa, but I want to display the column depending on the user's permissions, so I want the column there, but to start hidden.

              – dbcn
              Feb 7 '17 at 16:41















            3














            You can try with <item name="componentDisabled" xsi:type="boolean">true</item>



            For example:



            Vendor/Module/view/adminhtml/ui_component/product_form.xml



            <field name="backorders">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
            </argument>
            </field>





            share|improve this answer

























            • Thanks @Khoa, but I want to display the column depending on the user's permissions, so I want the column there, but to start hidden.

              – dbcn
              Feb 7 '17 at 16:41













            3












            3








            3







            You can try with <item name="componentDisabled" xsi:type="boolean">true</item>



            For example:



            Vendor/Module/view/adminhtml/ui_component/product_form.xml



            <field name="backorders">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
            </argument>
            </field>





            share|improve this answer















            You can try with <item name="componentDisabled" xsi:type="boolean">true</item>



            For example:



            Vendor/Module/view/adminhtml/ui_component/product_form.xml



            <field name="backorders">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
            </argument>
            </field>






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 7 '17 at 15:42

























            answered Feb 7 '17 at 15:26









            Khoa TruongDinhKhoa TruongDinh

            22k64187




            22k64187












            • Thanks @Khoa, but I want to display the column depending on the user's permissions, so I want the column there, but to start hidden.

              – dbcn
              Feb 7 '17 at 16:41

















            • Thanks @Khoa, but I want to display the column depending on the user's permissions, so I want the column there, but to start hidden.

              – dbcn
              Feb 7 '17 at 16:41
















            Thanks @Khoa, but I want to display the column depending on the user's permissions, so I want the column there, but to start hidden.

            – dbcn
            Feb 7 '17 at 16:41





            Thanks @Khoa, but I want to display the column depending on the user's permissions, so I want the column there, but to start hidden.

            – dbcn
            Feb 7 '17 at 16:41













            2














            use <item name="visible" xsi:type="boolean">false</item>
            in the config node of data argument when declaring column



            eg.



            <column name="created_at">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="resizeEnabled" xsi:type="boolean">false</item>
            <item name="filter" xsi:type="string">dateRange</item>
            <item name="sorting" xsi:type="string">desc</item>
            <item name="label" xsi:type="string" translate="true">Created at</item>
            <item name="sortOrder" xsi:type="number">120</item>
            <item name="visible" xsi:type="boolean">false</item>
            </item>
            </argument>
            </column>


            the only issue that the filter won't showing until you switch the column back to visible






            share|improve this answer

























            • Thanks @Mammouth, but this looks like a config setting - I want to be able to change the visibility based on the users role, so it would have to check it in code.

              – dbcn
              Jun 16 '17 at 17:18











            • acl wasn't created for this ... but for mimic something similar just extend/override Magento_Ui/view/base/web/js/grid/columns/column.js with your business logic

              – Mammouth
              Jun 20 '17 at 10:33











            • otehrwise I think would be good to open a new thread to your current problem (hiding column by user role settings), because this one already solved

              – Mammouth
              Jun 20 '17 at 10:43















            2














            use <item name="visible" xsi:type="boolean">false</item>
            in the config node of data argument when declaring column



            eg.



            <column name="created_at">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="resizeEnabled" xsi:type="boolean">false</item>
            <item name="filter" xsi:type="string">dateRange</item>
            <item name="sorting" xsi:type="string">desc</item>
            <item name="label" xsi:type="string" translate="true">Created at</item>
            <item name="sortOrder" xsi:type="number">120</item>
            <item name="visible" xsi:type="boolean">false</item>
            </item>
            </argument>
            </column>


            the only issue that the filter won't showing until you switch the column back to visible






            share|improve this answer

























            • Thanks @Mammouth, but this looks like a config setting - I want to be able to change the visibility based on the users role, so it would have to check it in code.

              – dbcn
              Jun 16 '17 at 17:18











            • acl wasn't created for this ... but for mimic something similar just extend/override Magento_Ui/view/base/web/js/grid/columns/column.js with your business logic

              – Mammouth
              Jun 20 '17 at 10:33











            • otehrwise I think would be good to open a new thread to your current problem (hiding column by user role settings), because this one already solved

              – Mammouth
              Jun 20 '17 at 10:43













            2












            2








            2







            use <item name="visible" xsi:type="boolean">false</item>
            in the config node of data argument when declaring column



            eg.



            <column name="created_at">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="resizeEnabled" xsi:type="boolean">false</item>
            <item name="filter" xsi:type="string">dateRange</item>
            <item name="sorting" xsi:type="string">desc</item>
            <item name="label" xsi:type="string" translate="true">Created at</item>
            <item name="sortOrder" xsi:type="number">120</item>
            <item name="visible" xsi:type="boolean">false</item>
            </item>
            </argument>
            </column>


            the only issue that the filter won't showing until you switch the column back to visible






            share|improve this answer















            use <item name="visible" xsi:type="boolean">false</item>
            in the config node of data argument when declaring column



            eg.



            <column name="created_at">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="resizeEnabled" xsi:type="boolean">false</item>
            <item name="filter" xsi:type="string">dateRange</item>
            <item name="sorting" xsi:type="string">desc</item>
            <item name="label" xsi:type="string" translate="true">Created at</item>
            <item name="sortOrder" xsi:type="number">120</item>
            <item name="visible" xsi:type="boolean">false</item>
            </item>
            </argument>
            </column>


            the only issue that the filter won't showing until you switch the column back to visible







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jun 15 '17 at 10:35









            Siarhey Uchukhlebau

            9,92693058




            9,92693058










            answered Jun 15 '17 at 10:16









            MammouthMammouth

            34137




            34137












            • Thanks @Mammouth, but this looks like a config setting - I want to be able to change the visibility based on the users role, so it would have to check it in code.

              – dbcn
              Jun 16 '17 at 17:18











            • acl wasn't created for this ... but for mimic something similar just extend/override Magento_Ui/view/base/web/js/grid/columns/column.js with your business logic

              – Mammouth
              Jun 20 '17 at 10:33











            • otehrwise I think would be good to open a new thread to your current problem (hiding column by user role settings), because this one already solved

              – Mammouth
              Jun 20 '17 at 10:43

















            • Thanks @Mammouth, but this looks like a config setting - I want to be able to change the visibility based on the users role, so it would have to check it in code.

              – dbcn
              Jun 16 '17 at 17:18











            • acl wasn't created for this ... but for mimic something similar just extend/override Magento_Ui/view/base/web/js/grid/columns/column.js with your business logic

              – Mammouth
              Jun 20 '17 at 10:33











            • otehrwise I think would be good to open a new thread to your current problem (hiding column by user role settings), because this one already solved

              – Mammouth
              Jun 20 '17 at 10:43
















            Thanks @Mammouth, but this looks like a config setting - I want to be able to change the visibility based on the users role, so it would have to check it in code.

            – dbcn
            Jun 16 '17 at 17:18





            Thanks @Mammouth, but this looks like a config setting - I want to be able to change the visibility based on the users role, so it would have to check it in code.

            – dbcn
            Jun 16 '17 at 17:18













            acl wasn't created for this ... but for mimic something similar just extend/override Magento_Ui/view/base/web/js/grid/columns/column.js with your business logic

            – Mammouth
            Jun 20 '17 at 10:33





            acl wasn't created for this ... but for mimic something similar just extend/override Magento_Ui/view/base/web/js/grid/columns/column.js with your business logic

            – Mammouth
            Jun 20 '17 at 10:33













            otehrwise I think would be good to open a new thread to your current problem (hiding column by user role settings), because this one already solved

            – Mammouth
            Jun 20 '17 at 10:43





            otehrwise I think would be good to open a new thread to your current problem (hiding column by user role settings), because this one already solved

            – Mammouth
            Jun 20 '17 at 10:43











            0














            Add below code in your ui xml to remove columns



            <column name="name_of_column">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
            </argument>
            </column>
            <field name="name_of_column">
            <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
            <item name="componentDisabled" xsi:type="boolean">true</item>
            </item>
            </argument>
            </field>





            share|improve this answer





























              0














              Add below code in your ui xml to remove columns



              <column name="name_of_column">
              <argument name="data" xsi:type="array">
              <item name="config" xsi:type="array">
              <item name="componentDisabled" xsi:type="boolean">true</item>
              </item>
              </argument>
              </column>
              <field name="name_of_column">
              <argument name="data" xsi:type="array">
              <item name="config" xsi:type="array">
              <item name="componentDisabled" xsi:type="boolean">true</item>
              </item>
              </argument>
              </field>





              share|improve this answer



























                0












                0








                0







                Add below code in your ui xml to remove columns



                <column name="name_of_column">
                <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
                </item>
                </argument>
                </column>
                <field name="name_of_column">
                <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
                </item>
                </argument>
                </field>





                share|improve this answer















                Add below code in your ui xml to remove columns



                <column name="name_of_column">
                <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
                </item>
                </argument>
                </column>
                <field name="name_of_column">
                <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                <item name="componentDisabled" xsi:type="boolean">true</item>
                </item>
                </argument>
                </field>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 25 mins ago









                Chirag Patel

                2,378423




                2,378423










                answered Jan 9 at 9:22









                Arvind HathiyaArvind Hathiya

                225




                225



























                    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%2f158596%2fmagento-2-how-do-i-hide-a-column-from-an-admin-grid%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

                    Disable / Remove link to Product Items in Cart Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How can I limit products that can be bought / added to cart?Remove item from cartHide “Add to Cart” button if specific products are already in cart“Prettifying” the custom options in cart pageCreate link in cart sidebar to view all added items After limit reachedLink products together in checkout/cartHow to Get product from cart and add it againHide action-edit on cart page if simple productRemoving Cart items - ObserverRemove wishlist items when added to cart

                    Helsingin valtaus Sisällysluettelo Taustaa | Yleistä sotatoimista | Osapuolet | Taistelut Helsingin ympäristössä | Punaisten antautumissuunnitelma | Taistelujen kulku Helsingissä | Valtauksen jälkeen | Tappiot | Muistaminen | Kirjallisuutta | Lähteet | Aiheesta muualla | NavigointivalikkoTeoksen verkkoversioTeoksen verkkoversioGoogle BooksSisällissota Helsingissä päättyi tasan 95 vuotta sittenSaksalaisten ylivoima jyräsi punaisen HelsinginSuomalaiset kuvaavat sotien jälkiä kaupungeissa – katso kuvat ja tarinat tutuilta kulmiltaHelsingin valtaus 90 vuotta sittenSaksalaiset valtasivat HelsinginHyökkäys HelsinkiinHelsingin valtaus 12.–13.4. 1918Saksalaiset käyttivät ihmiskilpiä Helsingin valtauksessa 1918Teoksen verkkoversioTeoksen verkkoversioSaksalaiset hyökkäävät Etelä-SuomeenTaistelut LeppävaarassaSotilaat ja taistelutLeppävaara 1918 huhtikuussa. KapinatarinaHelsingin taistelut 1918Saksalaisten voitonparaati HelsingissäHelsingin valtausta juhlittiinSaksalaisten Helsinki vuonna 1918Helsingin taistelussa kaatuneet valkokaartilaisetHelsinkiin haudatut taisteluissa kaatuneet punaiset12.4.1918 Helsingin valtauksessa saksalaiset apujoukot vapauttavat kaupunginVapaussodan muistomerkkejä Helsingissä ja pääkaupunkiseudullaCrescendo / Vuoden 1918 Kansalaissodan uhrien muistomerkkim

                    Adjektiivitarina Tarinan tekeminen | Esimerkki: ennen | Esimerkki: jälkeen | Navigointivalikko