Exploring Magento 2.2 UI Component - Part 3 Creating Admin Menu and Placeholder for Grid UI Component
In our Last Tutorial Exploring Magento 2.2 UI Component – Part 2 we have created the MODEL & Resource MODEL classes responsible for fetching the custom table data.
In this Tutorial we will create a custom Admin Menu and Admin Controller which is responsible for showing the Grid UI Component
Step 1:-To Display the list data in magento 2 admin panel, we need to create a new Top Level menu. For this example we will keep the Menu name as Upcoming Shows.
Mydons/Tradeshows/etc/adminhtml/menu.xml
[crayon-5bae2dbc74960807008467/]
The New top level menu should contain a unique id. The value given in the "title" attribute will be displayed in the admin panel. The "action" attribute specifies the frontName controller action. "resource" attribute is also an unique id which is used for admin ACL.
Custom Top Level Admin Menu will look as shown below
Step 2:- Whenever our custom admin top level menu "upcoming shows" is clicked it should go to a controller action. Before creating our Admin controller we need to configure the "frontName" in our case it is "tradeshows"
Mydons\Tradeshows\etc\adminhtml\routes.xml
[crayon-5bae2dbc74971415573133/]
Since we are defining the router for Admin Area, the "router" id should be mentioned as "admin"
Step 3:- Lets create our admin Controller
Mydons\Tradeshows\Controller\Adminhtml\Index\Index.php
[crayon-5bae2dbc7497c509848260/]
Once the Upcoming Shows Menu is clicked we will get the below output
The post Exploring Magento 2.2 UI Component – Part 3 appeared first on Mydons.