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

How can I make proper oatmeal cookies?

What does "shotgun unity" refer to here in this sentence?

What CSS properties can the br tag have?

How to get the last not-null value in an ordered column of a huge table?

Free fall ellipse or parabola?

Why did early computer designers eschew integers?

Asymptote: 3d graph over a disc

What steps are necessary to read a Modern SSD in Medieval Europe?

Is it OK to decorate a log book cover?

Is it ok to trim down a tube patch?

Inductor and Capacitor in Parallel

Calculate the Mean mean of two numbers

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

In the "Harry Potter and the Order of the Phoenix" video game, what potion is used to sabotage Umbridge's speakers?

Could a dragon use its wings to swim?

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

Defamation due to breach of confidentiality

Does higher Oxidation/ reduction potential translate to higher energy storage in battery?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Is French Guiana a (hard) EU border?

Won the lottery - how do I keep the money?

Is there a difference between "Fahrstuhl" and "Aufzug"?

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

What is the process for purifying your home if you believe it may have been previously used for pagan worship?



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

                    Nidaros erkebispedøme

                    Birsay

                    Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?