Magento 2 - How to add ajax tab on admin user edit page in admin sectionCategory edit page and ajaxMagento admin grid edit form display on left sideMagento 2: How to add grid to the tab in customer_index_editHow to add tab and grid to admin customer view magento2 using UI componentsAdd new tab in custom module admin side after custom account in Magento 1.9.2.4?custom backend tab in customer details with custom link to my custom controllerMagento2.2 uiComponent tab in edit pageMagento 2 :- How can i add tab in customer group?Magento 2 Can't add new tab in product page in adminMagento 2.2.6 How to add TAB structure in admin UI component form

How do I calculate APR from monthly instalments?

How do photons get into the eyes?

Credit card offering 0.5 miles for every cent rounded up. Too good to be true?

Movie where a boy is transported into the future by an alien spaceship

What risks are there when you clear your cookies instead of logging off?

Accidentally renamed tar.gz file to a non tar.gz file, will my file be messed up

Bug using breqn and babel

Completing the square to find if quadratic form is positive definite.

Building a road to escape Earth's gravity by making a pyramid on Antartica

Function to extract float from different price patterns

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?

How do I write "Show, Don't Tell" as an Asperger?

How can this map be coloured using four colours?

Implement Homestuck's Catenative Doomsday Dice Cascader

PRBHA-10: A hashing algorithm in Python

Etymology of 'calcit(r)are'?

Who operates delivery flights for commercial airlines?

Importance sampling estimation of power function

Avoiding cliches when writing gods

How to skip replacing first occurrence of a character in each line?

Does the growth of home value benefit from compound interest?

Should I "tell" my exposition or give it through dialogue?

Is it possible for people to live in the eye of a permanent hypercane?

In this example, which path would a monster affected by the Dissonant Whispers spell take?



Magento 2 - How to add ajax tab on admin user edit page in admin section


Category edit page and ajaxMagento admin grid edit form display on left sideMagento 2: How to add grid to the tab in customer_index_editHow to add tab and grid to admin customer view magento2 using UI componentsAdd new tab in custom module admin side after custom account in Magento 1.9.2.4?custom backend tab in customer details with custom link to my custom controllerMagento2.2 uiComponent tab in edit pageMagento 2 :- How can i add tab in customer group?Magento 2 Can't add new tab in product page in adminMagento 2.2.6 How to add TAB structure in admin UI component form






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








0















I want to add a tab on User edit page which can be accessed from grid in section System -> All users. I have managed to add tab but it is not loading through AJAX. When I click on tab it redirects to another URL.



Please see screen shot and code below.



enter image description here



Code:-



/app/code/Namespace/Module/Block/Adminhtml/Edit/Tab/Customer.php



<?php
namespace NamespaceModuleBlockAdminhtmlEditTab;

class Customer extends MagentoBackendBlockWidgetTabs

/**
* Class constructor
*
* @return void
*/
protected function _construct()

parent::_construct();
$this->setId('page_tabs');
$this->setDestElementId('edit_form');


/**
* @return $this
*/
protected function _beforeToHtml()


$this->addTab(
'magcr_customer_section',
[
'label' => __('Select Customer(s)'),
'title' => __('Select Customer(s)'),
'url' => $this->getUrl('magcr/index/customer'),
'class' => 'ajax',
'active' => FALSE
]
);
return parent::_beforeToHtml();




/app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml



<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="left">
<block class="NamespaceModuleBlockAdminhtmlEditTabCustomer" name="adminhtml.user.edit.tabs1"/>
</referenceContainer>
</body>
</page>


Please help what am I doing wrong.



UPDATE



When I modify below code in constructor of block class, the tabs loads through ajax.



$this->setId('magcr_page_tabs');



But now problem is both 'User Info' and 'Select Customer(s)' load automatically on page load.










share|improve this question






























    0















    I want to add a tab on User edit page which can be accessed from grid in section System -> All users. I have managed to add tab but it is not loading through AJAX. When I click on tab it redirects to another URL.



    Please see screen shot and code below.



    enter image description here



    Code:-



    /app/code/Namespace/Module/Block/Adminhtml/Edit/Tab/Customer.php



    <?php
    namespace NamespaceModuleBlockAdminhtmlEditTab;

    class Customer extends MagentoBackendBlockWidgetTabs

    /**
    * Class constructor
    *
    * @return void
    */
    protected function _construct()

    parent::_construct();
    $this->setId('page_tabs');
    $this->setDestElementId('edit_form');


    /**
    * @return $this
    */
    protected function _beforeToHtml()


    $this->addTab(
    'magcr_customer_section',
    [
    'label' => __('Select Customer(s)'),
    'title' => __('Select Customer(s)'),
    'url' => $this->getUrl('magcr/index/customer'),
    'class' => 'ajax',
    'active' => FALSE
    ]
    );
    return parent::_beforeToHtml();




    /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml



    <?xml version="1.0"?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
    <referenceContainer name="left">
    <block class="NamespaceModuleBlockAdminhtmlEditTabCustomer" name="adminhtml.user.edit.tabs1"/>
    </referenceContainer>
    </body>
    </page>


    Please help what am I doing wrong.



    UPDATE



    When I modify below code in constructor of block class, the tabs loads through ajax.



    $this->setId('magcr_page_tabs');



    But now problem is both 'User Info' and 'Select Customer(s)' load automatically on page load.










    share|improve this question


























      0












      0








      0








      I want to add a tab on User edit page which can be accessed from grid in section System -> All users. I have managed to add tab but it is not loading through AJAX. When I click on tab it redirects to another URL.



      Please see screen shot and code below.



      enter image description here



      Code:-



      /app/code/Namespace/Module/Block/Adminhtml/Edit/Tab/Customer.php



      <?php
      namespace NamespaceModuleBlockAdminhtmlEditTab;

      class Customer extends MagentoBackendBlockWidgetTabs

      /**
      * Class constructor
      *
      * @return void
      */
      protected function _construct()

      parent::_construct();
      $this->setId('page_tabs');
      $this->setDestElementId('edit_form');


      /**
      * @return $this
      */
      protected function _beforeToHtml()


      $this->addTab(
      'magcr_customer_section',
      [
      'label' => __('Select Customer(s)'),
      'title' => __('Select Customer(s)'),
      'url' => $this->getUrl('magcr/index/customer'),
      'class' => 'ajax',
      'active' => FALSE
      ]
      );
      return parent::_beforeToHtml();




      /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml



      <?xml version="1.0"?>
      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <body>
      <referenceContainer name="left">
      <block class="NamespaceModuleBlockAdminhtmlEditTabCustomer" name="adminhtml.user.edit.tabs1"/>
      </referenceContainer>
      </body>
      </page>


      Please help what am I doing wrong.



      UPDATE



      When I modify below code in constructor of block class, the tabs loads through ajax.



      $this->setId('magcr_page_tabs');



      But now problem is both 'User Info' and 'Select Customer(s)' load automatically on page load.










      share|improve this question
















      I want to add a tab on User edit page which can be accessed from grid in section System -> All users. I have managed to add tab but it is not loading through AJAX. When I click on tab it redirects to another URL.



      Please see screen shot and code below.



      enter image description here



      Code:-



      /app/code/Namespace/Module/Block/Adminhtml/Edit/Tab/Customer.php



      <?php
      namespace NamespaceModuleBlockAdminhtmlEditTab;

      class Customer extends MagentoBackendBlockWidgetTabs

      /**
      * Class constructor
      *
      * @return void
      */
      protected function _construct()

      parent::_construct();
      $this->setId('page_tabs');
      $this->setDestElementId('edit_form');


      /**
      * @return $this
      */
      protected function _beforeToHtml()


      $this->addTab(
      'magcr_customer_section',
      [
      'label' => __('Select Customer(s)'),
      'title' => __('Select Customer(s)'),
      'url' => $this->getUrl('magcr/index/customer'),
      'class' => 'ajax',
      'active' => FALSE
      ]
      );
      return parent::_beforeToHtml();




      /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml



      <?xml version="1.0"?>
      <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <body>
      <referenceContainer name="left">
      <block class="NamespaceModuleBlockAdminhtmlEditTabCustomer" name="adminhtml.user.edit.tabs1"/>
      </referenceContainer>
      </body>
      </page>


      Please help what am I doing wrong.



      UPDATE



      When I modify below code in constructor of block class, the tabs loads through ajax.



      $this->setId('magcr_page_tabs');



      But now problem is both 'User Info' and 'Select Customer(s)' load automatically on page load.







      admin ajax tabs magento-2.0.6






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 23 '16 at 7:03







      piyush_systematix

















      asked Jun 23 '16 at 6:48









      piyush_systematixpiyush_systematix

      96431930




      96431930




















          1 Answer
          1






          active

          oldest

          votes


















          0














          For example, I add Websites tab



          1. Find current tabs reference "adminhtml.user.edit.tabs"
            https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml#L11


          2. Create your module view xml



          /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml






           <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
          <body>
          <referenceBlock name="adminhtml.user.edit.tabs">
          <block class="MagentoCatalogBlockAdminhtmlProductEditActionAttributeTabWebsites" name="tab_websites" template="Magento_Catalog::catalog/product/edit/action/websites.phtml"/>
          <action method="addTab">
          <argument name="name" xsi:type="string">websites</argument>
          <argument name="block" xsi:type="string">tab_websites</argument>
          </action>
          </referenceBlock>
          </body>
          </page>





          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%2f122396%2fmagento-2-how-to-add-ajax-tab-on-admin-user-edit-page-in-admin-section%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














            For example, I add Websites tab



            1. Find current tabs reference "adminhtml.user.edit.tabs"
              https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml#L11


            2. Create your module view xml



            /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml






             <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
            <body>
            <referenceBlock name="adminhtml.user.edit.tabs">
            <block class="MagentoCatalogBlockAdminhtmlProductEditActionAttributeTabWebsites" name="tab_websites" template="Magento_Catalog::catalog/product/edit/action/websites.phtml"/>
            <action method="addTab">
            <argument name="name" xsi:type="string">websites</argument>
            <argument name="block" xsi:type="string">tab_websites</argument>
            </action>
            </referenceBlock>
            </body>
            </page>





            share|improve this answer





























              0














              For example, I add Websites tab



              1. Find current tabs reference "adminhtml.user.edit.tabs"
                https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml#L11


              2. Create your module view xml



              /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml






               <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
              <body>
              <referenceBlock name="adminhtml.user.edit.tabs">
              <block class="MagentoCatalogBlockAdminhtmlProductEditActionAttributeTabWebsites" name="tab_websites" template="Magento_Catalog::catalog/product/edit/action/websites.phtml"/>
              <action method="addTab">
              <argument name="name" xsi:type="string">websites</argument>
              <argument name="block" xsi:type="string">tab_websites</argument>
              </action>
              </referenceBlock>
              </body>
              </page>





              share|improve this answer



























                0












                0








                0







                For example, I add Websites tab



                1. Find current tabs reference "adminhtml.user.edit.tabs"
                  https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml#L11


                2. Create your module view xml



                /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml






                 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="adminhtml.user.edit.tabs">
                <block class="MagentoCatalogBlockAdminhtmlProductEditActionAttributeTabWebsites" name="tab_websites" template="Magento_Catalog::catalog/product/edit/action/websites.phtml"/>
                <action method="addTab">
                <argument name="name" xsi:type="string">websites</argument>
                <argument name="block" xsi:type="string">tab_websites</argument>
                </action>
                </referenceBlock>
                </body>
                </page>





                share|improve this answer















                For example, I add Websites tab



                1. Find current tabs reference "adminhtml.user.edit.tabs"
                  https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_edit.xml#L11


                2. Create your module view xml



                /app/code/Namespace/Module/view/adminhtml/layout/adminhtml_user_edit.xml






                 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="adminhtml.user.edit.tabs">
                <block class="MagentoCatalogBlockAdminhtmlProductEditActionAttributeTabWebsites" name="tab_websites" template="Magento_Catalog::catalog/product/edit/action/websites.phtml"/>
                <action method="addTab">
                <argument name="name" xsi:type="string">websites</argument>
                <argument name="block" xsi:type="string">tab_websites</argument>
                </action>
                </referenceBlock>
                </body>
                </page>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 22 '18 at 9:05









                Rama Chandran M

                2,75281530




                2,75281530










                answered May 22 '18 at 8:43









                0m3r0m3r

                112




                112



























                    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%2f122396%2fmagento-2-how-to-add-ajax-tab-on-admin-user-edit-page-in-admin-section%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

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?