Add column to gridview in custom extension The 2019 Stack Overflow Developer Survey Results Are InMagento2 : Display two table column values in single UI grid columnHow can i rewrite TierPrice Block in Magento2Magento2: store_id in UI Listing ComponentCustom renderered column sorting not working magento2magento2 uicomponent filter on id column on bases of text searchMagento 2:SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'entity_id' in where clause is ambiguousMagento2: New Customer grid column breaks the export functionalityAdd column in Admin custom module (to filter products results)Grid action column custom callback with multiple params in magento2How to populate data in custom filed in product edit form in Magento 2Magento 2 - Custom Customer attribute in order create select customer grid

Return to UK after being refused entry years previously

"as much details as you can remember"

Is there any way to tell whether the shot is going to hit you or not?

Why is the maximum length of OpenWrt’s root password 8 characters?

Identify boardgame from Big movie

What is the closest word meaning "respect for time / mindful"

Landlord wants to switch my lease to a "Land contract" to "get back at the city"

Have you ever entered Singapore using a different passport or name?

How are circuits which use complex ICs normally simulated?

What is the meaning of the verb "bear" in this context?

double encryption - One Time Pad

Can a flute soloist sit?

FPGA - DIY Programming

What do the Banks children have against barley water?

Building a conditional check constraint

Are there incongruent pythagorean triangles with the same perimeter and same area?

What is the meaning of Triage in Cybersec world?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

Identify This Plant (Flower)

Why do UK politicians seemingly ignore opinion polls on Brexit?

What did it mean to "align" a radio?

Earliest use of the term "Galois extension"?

Loose spokes after only a few rides

Who coined the term "madman theory"?



Add column to gridview in custom extension



The 2019 Stack Overflow Developer Survey Results Are InMagento2 : Display two table column values in single UI grid columnHow can i rewrite TierPrice Block in Magento2Magento2: store_id in UI Listing ComponentCustom renderered column sorting not working magento2magento2 uicomponent filter on id column on bases of text searchMagento 2:SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'entity_id' in where clause is ambiguousMagento2: New Customer grid column breaks the export functionalityAdd column in Admin custom module (to filter products results)Grid action column custom callback with multiple params in magento2How to populate data in custom filed in product edit form in Magento 2Magento 2 - Custom Customer attribute in order create select customer grid



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have a custom extension where the admin user needs to select a customer from the drop down. The extension saves the customer ID to the database.



Currently, on the grid view, in my UI component I have the following:



 <column name="customer_id">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">textRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Customer ID</item>
</item>
</argument>
</column>


This displays the customer id as expected.



However, my question is how do actually display the customer name instead of just the ID in the grid view?










share|improve this question




























    1















    I have a custom extension where the admin user needs to select a customer from the drop down. The extension saves the customer ID to the database.



    Currently, on the grid view, in my UI component I have the following:



     <column name="customer_id">
    <argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
    <item name="filter" xsi:type="string">textRange</item>
    <item name="sorting" xsi:type="string">asc</item>
    <item name="label" xsi:type="string" translate="true">Customer ID</item>
    </item>
    </argument>
    </column>


    This displays the customer id as expected.



    However, my question is how do actually display the customer name instead of just the ID in the grid view?










    share|improve this question
























      1












      1








      1








      I have a custom extension where the admin user needs to select a customer from the drop down. The extension saves the customer ID to the database.



      Currently, on the grid view, in my UI component I have the following:



       <column name="customer_id">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="filter" xsi:type="string">textRange</item>
      <item name="sorting" xsi:type="string">asc</item>
      <item name="label" xsi:type="string" translate="true">Customer ID</item>
      </item>
      </argument>
      </column>


      This displays the customer id as expected.



      However, my question is how do actually display the customer name instead of just the ID in the grid view?










      share|improve this question














      I have a custom extension where the admin user needs to select a customer from the drop down. The extension saves the customer ID to the database.



      Currently, on the grid view, in my UI component I have the following:



       <column name="customer_id">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="filter" xsi:type="string">textRange</item>
      <item name="sorting" xsi:type="string">asc</item>
      <item name="label" xsi:type="string" translate="true">Customer ID</item>
      </item>
      </argument>
      </column>


      This displays the customer id as expected.



      However, my question is how do actually display the customer name instead of just the ID in the grid view?







      magento2 grid uicomponent grid-layout






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 7 at 10:39









      Goose84Goose84

      1,30911242




      1,30911242




















          1 Answer
          1






          active

          oldest

          votes


















          0














          You have to define your own custom class in order to get and display the firstname and the lastname of the customer in one UI column field, otherwise you can either use only one of them.

          Like below code:



          <column name="customer_firstname">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="filter" xsi:type="string">textRange</item>
          <item name="sorting" xsi:type="string">asc</item>
          <item name="label" xsi:type="string" translate="true">Customer Firstname</item>
          </item>
          </argument>
          </column>





          share|improve this answer























          • How would you define my own custom class and what would be the contents?

            – Goose84
            Apr 7 at 10:57











          • You can check like this one : magento.stackexchange.com/questions/178286/…

            – magefms
            Apr 7 at 11:00






          • 1





            The issue with this method though I would have to do logic on each row? I was thinking if I join in the customer_entity table then the extension would be more efficient, wouldn't it?

            – Goose84
            Apr 7 at 11:06











          • yeah you are right with that I can agree.

            – magefms
            Apr 7 at 11:07











          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%2f269045%2fadd-column-to-gridview-in-custom-extension%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









          0














          You have to define your own custom class in order to get and display the firstname and the lastname of the customer in one UI column field, otherwise you can either use only one of them.

          Like below code:



          <column name="customer_firstname">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="filter" xsi:type="string">textRange</item>
          <item name="sorting" xsi:type="string">asc</item>
          <item name="label" xsi:type="string" translate="true">Customer Firstname</item>
          </item>
          </argument>
          </column>





          share|improve this answer























          • How would you define my own custom class and what would be the contents?

            – Goose84
            Apr 7 at 10:57











          • You can check like this one : magento.stackexchange.com/questions/178286/…

            – magefms
            Apr 7 at 11:00






          • 1





            The issue with this method though I would have to do logic on each row? I was thinking if I join in the customer_entity table then the extension would be more efficient, wouldn't it?

            – Goose84
            Apr 7 at 11:06











          • yeah you are right with that I can agree.

            – magefms
            Apr 7 at 11:07















          0














          You have to define your own custom class in order to get and display the firstname and the lastname of the customer in one UI column field, otherwise you can either use only one of them.

          Like below code:



          <column name="customer_firstname">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="filter" xsi:type="string">textRange</item>
          <item name="sorting" xsi:type="string">asc</item>
          <item name="label" xsi:type="string" translate="true">Customer Firstname</item>
          </item>
          </argument>
          </column>





          share|improve this answer























          • How would you define my own custom class and what would be the contents?

            – Goose84
            Apr 7 at 10:57











          • You can check like this one : magento.stackexchange.com/questions/178286/…

            – magefms
            Apr 7 at 11:00






          • 1





            The issue with this method though I would have to do logic on each row? I was thinking if I join in the customer_entity table then the extension would be more efficient, wouldn't it?

            – Goose84
            Apr 7 at 11:06











          • yeah you are right with that I can agree.

            – magefms
            Apr 7 at 11:07













          0












          0








          0







          You have to define your own custom class in order to get and display the firstname and the lastname of the customer in one UI column field, otherwise you can either use only one of them.

          Like below code:



          <column name="customer_firstname">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="filter" xsi:type="string">textRange</item>
          <item name="sorting" xsi:type="string">asc</item>
          <item name="label" xsi:type="string" translate="true">Customer Firstname</item>
          </item>
          </argument>
          </column>





          share|improve this answer













          You have to define your own custom class in order to get and display the firstname and the lastname of the customer in one UI column field, otherwise you can either use only one of them.

          Like below code:



          <column name="customer_firstname">
          <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
          <item name="filter" xsi:type="string">textRange</item>
          <item name="sorting" xsi:type="string">asc</item>
          <item name="label" xsi:type="string" translate="true">Customer Firstname</item>
          </item>
          </argument>
          </column>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 7 at 10:51









          magefmsmagefms

          2,5932526




          2,5932526












          • How would you define my own custom class and what would be the contents?

            – Goose84
            Apr 7 at 10:57











          • You can check like this one : magento.stackexchange.com/questions/178286/…

            – magefms
            Apr 7 at 11:00






          • 1





            The issue with this method though I would have to do logic on each row? I was thinking if I join in the customer_entity table then the extension would be more efficient, wouldn't it?

            – Goose84
            Apr 7 at 11:06











          • yeah you are right with that I can agree.

            – magefms
            Apr 7 at 11:07

















          • How would you define my own custom class and what would be the contents?

            – Goose84
            Apr 7 at 10:57











          • You can check like this one : magento.stackexchange.com/questions/178286/…

            – magefms
            Apr 7 at 11:00






          • 1





            The issue with this method though I would have to do logic on each row? I was thinking if I join in the customer_entity table then the extension would be more efficient, wouldn't it?

            – Goose84
            Apr 7 at 11:06











          • yeah you are right with that I can agree.

            – magefms
            Apr 7 at 11:07
















          How would you define my own custom class and what would be the contents?

          – Goose84
          Apr 7 at 10:57





          How would you define my own custom class and what would be the contents?

          – Goose84
          Apr 7 at 10:57













          You can check like this one : magento.stackexchange.com/questions/178286/…

          – magefms
          Apr 7 at 11:00





          You can check like this one : magento.stackexchange.com/questions/178286/…

          – magefms
          Apr 7 at 11:00




          1




          1





          The issue with this method though I would have to do logic on each row? I was thinking if I join in the customer_entity table then the extension would be more efficient, wouldn't it?

          – Goose84
          Apr 7 at 11:06





          The issue with this method though I would have to do logic on each row? I was thinking if I join in the customer_entity table then the extension would be more efficient, wouldn't it?

          – Goose84
          Apr 7 at 11:06













          yeah you are right with that I can agree.

          – magefms
          Apr 7 at 11:07





          yeah you are right with that I can agree.

          – magefms
          Apr 7 at 11:07

















          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%2f269045%2fadd-column-to-gridview-in-custom-extension%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

          Bulk add to cart function issuecart vs. mini cart issue … rwd themeRedirect Add to cart button to cart pageAdd to cart issue - Magento 2.1The requested Payment Method is not available When creating an orderM2: reason add-to-cart might not function in production modeAdd to cart issue in some android devicesMagento 2 - custom price can not add to subtotal and grand total after add to cartAdd to cart codeIssue with my cart module on pdp and cart pages, just keeps spinningBulk price and quantity update using rest api

          Magento2 - How to hide price filter only in specific categories?Multiselect price filter attribute in layered navigationhide only some categories from layered navigation in magentoRemove Price Filter on certain categoriescustomize layered price filter?Hide Price for a particular customer groupPrice filter in layered navigation not working correctly with price including tax in magento 2.2.3Magento 2 how to hide attribute at Layered navigation?Magento 2. how to hide price only for specific categoriesMagento 2 How can I hide the price and total from cart and checkout summary?Magento2: Can we add navigation layered filter like price filter for other attribute?