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

                    Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                    Magento 2 disable Secret Key on URL's from terminal The Next CEO of Stack OverflowMagento 2 Shortcut/GUI tool to perform commandline tasks for windowsIn menu add configuration linkMagento oAuth : Generating access token and access secretMagento 2 security key issue in Third-Party API redirect URIPublic actions in admin controllersHow to Disable Cache in Custom WidgetURL Key not changing in Magento 2Product URL Key gets deleted when importing custom options - Magento 2Problem with reindex terminalMagento 2 - bin/magento Commands not working in Cpanel Terminal

                    Aasi (pallopeli) Navigointivalikko