Mag admin grid: Difference between revisions

From SocalApp Solutions Wiki
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
File: app/code/Mageplaza/HelloWorld/etc/adminhtml/routes.xml
File: app/code/Mageplaza/HelloWorld/etc/adminhtml/routes.xml


<nowiki><?xml version="1.0"?>
<syntaxhighlight lang="xml" line>
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
     <router id="admin">
     <router id="admin">
Line 21: Line 22:
         </route>
         </route>
     </router>
     </router>
</config></nowiki>
</config></syntaxhighlight>




{{tag: magento2 admin grid }}
__tag: magento2 admin grid__

Latest revision as of 15:17, 17 May 2024

How to Save Admin Grid in Magento 2

In this article, we will find how to create an Admin Grid in Magento 2 backend. As you know, Magento 2 Grid is a kind of table which listing the items in your database table and provide you some features like: sort, filter, delete, update item, etc. The helloWorld for this is the grid of products, grid of customer.

Magento 2 provide two ways to create Admin Grid: using layout and using component. In this guide we use UI Component.

To Create Admin Grid

  • Step 1: Create routes admin
  • Step 2: Create admin menu
  • Step 3: Create Controller
  • Step 4: Create Admin Grid using Component
  • Step 5: Create Admin Grid using Layout

1. Create routes admin

File: app/code/Mageplaza/HelloWorld/etc/adminhtml/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="mageplaza_helloworld" frontName="mageplaza_helloworld">
            <module name="Mageplaza_HelloWorld"/>
        </route>
    </router>
</config>


__tag: magento2 admin grid__