What is difference between Creating Admin Grid with using Layout and Using Component












5















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.










share|improve this question





























    5















    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.










    share|improve this question



























      5












      5








      5


      3






      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 4 '18 at 12:21







      akgola

















      asked May 4 '18 at 12:09









      akgolaakgola

      1,322516




      1,322516






















          1 Answer
          1






          active

          oldest

          votes


















          5














          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





          share|improve this answer





















          • 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











          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%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









          5














          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





          share|improve this answer





















          • 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
















          5














          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





          share|improve this answer





















          • 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














          5












          5








          5







          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





          share|improve this answer















          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






          share|improve this answer














          share|improve this answer



          share|improve this answer








          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.2 in the class. That might be a worthwhile negative for the layout version

            – Rian
            May 30 '18 at 11:52














          • 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








          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


















          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%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





















































          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

          William S. Burroughs

          Eda skans

          What is the difference between apt, apt-get and git?