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
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
add a comment |
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
add a comment |
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
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
magento2 admin grid uicomponent
edited Apr 13 '17 at 12:55
Community♦
1
1
asked Feb 7 '17 at 15:06
dbcndbcn
409313
409313
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
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>
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
add a comment |
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
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/overrideMagento_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
add a comment |
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>
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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>
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
add a comment |
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>
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
add a comment |
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>
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>
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
add a comment |
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
add a comment |
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
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/overrideMagento_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
add a comment |
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
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/overrideMagento_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
add a comment |
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
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
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/overrideMagento_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
add a comment |
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/overrideMagento_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
add a comment |
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>
add a comment |
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>
add a comment |
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>
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>
edited 25 mins ago
Chirag Patel
2,378423
2,378423
answered Jan 9 at 9:22
Arvind HathiyaArvind Hathiya
225
225
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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