What is difference between Creating Admin Grid with using Layout and Using Component
As we are aware that we can create Admin Grid to display list of item from database table with two ways:
1.Using layout
2.Using component
I want to know which one is best and what is difference between both approaches? Please share your thoughts.
magento2 layout uicomponent
add a comment |
As we are aware that we can create Admin Grid to display list of item from database table with two ways:
1.Using layout
2.Using component
I want to know which one is best and what is difference between both approaches? Please share your thoughts.
magento2 layout uicomponent
add a comment |
As we are aware that we can create Admin Grid to display list of item from database table with two ways:
1.Using layout
2.Using component
I want to know which one is best and what is difference between both approaches? Please share your thoughts.
magento2 layout uicomponent
As we are aware that we can create Admin Grid to display list of item from database table with two ways:
1.Using layout
2.Using component
I want to know which one is best and what is difference between both approaches? Please share your thoughts.
magento2 layout uicomponent
magento2 layout uicomponent
edited May 4 '18 at 12:21
akgola
asked May 4 '18 at 12:09
akgolaakgola
1,322516
1,322516
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
UI Components:
+ It's mostly configuration. So you write less code.
+ you get a cool grid with show/hide columns,drag/drop columns, full text search, inline edit, export built in and maybe others.
+ It can easily be extended with just another XML file in a different module.
+ any new feature Magento rolls out for the grids you will get it automatically in your grid.
- Difficult to debug.
- Difficult to modify.
- Difficult to build non standard grids.
- Not very much control over what happens.
Layout:
+ You got full control of what happens.
+ Relatively easy to build non-standard grids.
+ Easy to debug
+ You can use your knowledge from M1 to do it.
- Grid is not that flexible or extensible.
- you need to write the same code over and over again.
- More code to test or that can break
2
One small note, the layout/block way is being deprecated in favor of the ui-component. See@deprecated 100.2.0 in favour of UI component implementation * @since 100.0.2in the class. That might be a worthwhile negative for the layout version
– Rian
May 30 '18 at 11:52
add a comment |
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
});
}
});
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%2f224760%2fwhat-is-difference-between-creating-admin-grid-with-using-layout-and-using-compo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
UI Components:
+ It's mostly configuration. So you write less code.
+ you get a cool grid with show/hide columns,drag/drop columns, full text search, inline edit, export built in and maybe others.
+ It can easily be extended with just another XML file in a different module.
+ any new feature Magento rolls out for the grids you will get it automatically in your grid.
- Difficult to debug.
- Difficult to modify.
- Difficult to build non standard grids.
- Not very much control over what happens.
Layout:
+ You got full control of what happens.
+ Relatively easy to build non-standard grids.
+ Easy to debug
+ You can use your knowledge from M1 to do it.
- Grid is not that flexible or extensible.
- you need to write the same code over and over again.
- More code to test or that can break
2
One small note, the layout/block way is being deprecated in favor of the ui-component. See@deprecated 100.2.0 in favour of UI component implementation * @since 100.0.2in the class. That might be a worthwhile negative for the layout version
– Rian
May 30 '18 at 11:52
add a comment |
UI Components:
+ It's mostly configuration. So you write less code.
+ you get a cool grid with show/hide columns,drag/drop columns, full text search, inline edit, export built in and maybe others.
+ It can easily be extended with just another XML file in a different module.
+ any new feature Magento rolls out for the grids you will get it automatically in your grid.
- Difficult to debug.
- Difficult to modify.
- Difficult to build non standard grids.
- Not very much control over what happens.
Layout:
+ You got full control of what happens.
+ Relatively easy to build non-standard grids.
+ Easy to debug
+ You can use your knowledge from M1 to do it.
- Grid is not that flexible or extensible.
- you need to write the same code over and over again.
- More code to test or that can break
2
One small note, the layout/block way is being deprecated in favor of the ui-component. See@deprecated 100.2.0 in favour of UI component implementation * @since 100.0.2in the class. That might be a worthwhile negative for the layout version
– Rian
May 30 '18 at 11:52
add a comment |
UI Components:
+ It's mostly configuration. So you write less code.
+ you get a cool grid with show/hide columns,drag/drop columns, full text search, inline edit, export built in and maybe others.
+ It can easily be extended with just another XML file in a different module.
+ any new feature Magento rolls out for the grids you will get it automatically in your grid.
- Difficult to debug.
- Difficult to modify.
- Difficult to build non standard grids.
- Not very much control over what happens.
Layout:
+ You got full control of what happens.
+ Relatively easy to build non-standard grids.
+ Easy to debug
+ You can use your knowledge from M1 to do it.
- Grid is not that flexible or extensible.
- you need to write the same code over and over again.
- More code to test or that can break
UI Components:
+ It's mostly configuration. So you write less code.
+ you get a cool grid with show/hide columns,drag/drop columns, full text search, inline edit, export built in and maybe others.
+ It can easily be extended with just another XML file in a different module.
+ any new feature Magento rolls out for the grids you will get it automatically in your grid.
- Difficult to debug.
- Difficult to modify.
- Difficult to build non standard grids.
- Not very much control over what happens.
Layout:
+ You got full control of what happens.
+ Relatively easy to build non-standard grids.
+ Easy to debug
+ You can use your knowledge from M1 to do it.
- Grid is not that flexible or extensible.
- you need to write the same code over and over again.
- More code to test or that can break
edited 2 days ago
answered May 4 '18 at 13:25
Jagdish BarotJagdish Barot
1049
1049
2
One small note, the layout/block way is being deprecated in favor of the ui-component. See@deprecated 100.2.0 in favour of UI component implementation * @since 100.0.2in the class. That might be a worthwhile negative for the layout version
– Rian
May 30 '18 at 11:52
add a comment |
2
One small note, the layout/block way is being deprecated in favor of the ui-component. See@deprecated 100.2.0 in favour of UI component implementation * @since 100.0.2in the class. That might be a worthwhile negative for the layout version
– Rian
May 30 '18 at 11:52
2
2
One small note, the layout/block way is being deprecated in favor of the ui-component. See
@deprecated 100.2.0 in favour of UI component implementation * @since 100.0.2 in the class. That might be a worthwhile negative for the layout version– Rian
May 30 '18 at 11:52
One small note, the layout/block way is being deprecated in favor of the ui-component. See
@deprecated 100.2.0 in favour of UI component implementation * @since 100.0.2 in the class. That might be a worthwhile negative for the layout version– Rian
May 30 '18 at 11:52
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%2f224760%2fwhat-is-difference-between-creating-admin-grid-with-using-layout-and-using-compo%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