{"id":1722,"date":"2020-04-02T11:29:23","date_gmt":"2020-04-02T11:29:23","guid":{"rendered":"https:\/\/www.magetop.com\/blog\/?p=1722"},"modified":"2021-07-22T02:55:56","modified_gmt":"2021-07-22T02:55:56","slug":"admin-grid-crud-in-magento","status":"publish","type":"post","link":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/","title":{"rendered":"Admin Grid CRUD In Magento 2"},"content":{"rendered":"\n<p>In the previous article, I introduced <a href=\"https:\/\/www.magetop.com\/blog\/how-to-add-mass-actions-in-magento\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Add Mass Actions In Magento 2<\/a>. In this article, we will learn about Admin Grid CRUD In Magento 2.<\/p>\n\n\n\n<p>This is a series on Magento 2 Extension Tutorial. The lessons are related to each other so you should read step by step.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Module File Structure<\/h2>\n\n\n\n<p>We updated our module file structure looks as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"902\" data-attachment-id=\"1737\" data-permalink=\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/admin-grid-crud-folder-structure\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/admin-grid-crud-folder-structure.png?fit=448%2C902&amp;ssl=1\" data-orig-size=\"448,902\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"admin-grid-crud-folder-structure\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/admin-grid-crud-folder-structure.png?fit=149%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/admin-grid-crud-folder-structure.png?fit=448%2C902&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/admin-grid-crud-folder-structure.png?resize=448%2C902&#038;ssl=1\" alt=\"admin grid crud folder structure\" class=\"wp-image-1737\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/admin-grid-crud-folder-structure.png?w=448&amp;ssl=1 448w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/admin-grid-crud-folder-structure.png?resize=149%2C300&amp;ssl=1 149w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Create Edit Form<\/h2>\n\n\n\n<p>First, You create Edit.php in the Block folder following the path: Magetop\/Helloworld\/Block\/Adminhtml\/Posts\/Edit.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Block\\Adminhtml\\Posts;\n\nuse Magento\\Backend\\Block\\Widget\\Form\\Container;\nuse Magento\\Backend\\Block\\Widget\\Context;\nuse Magento\\Framework\\Registry;\n\nclass Edit extends Container\n{\n    \/**\n     * Core registry\n     *\n     * @var \\Magento\\Framework\\Registry\n     *\/\n    protected $_coreRegistry = null;\n\n    \/**\n     * @param Context $context\n     * @param Registry $registry\n     * @param array $data\n     *\/\n    public function __construct(\n        Context $context,\n        Registry $registry,\n        array $data = &#x5B;]\n    ) {\n        $this-&gt;_coreRegistry = $registry;\n        parent::__construct($context, $data);\n    }\n\n    \/**\n     * Class constructor\n     *\n     * @return void\n     *\/\n    protected function _construct()\n    {\n        $this-&gt;_objectId = 'id';\n        $this-&gt;_controller = 'adminhtml_posts';\n        $this-&gt;_blockGroup = 'Magetop_Helloworld';\n\n        parent::_construct();\n\n        $this-&gt;buttonList-&gt;update('save', 'label', __('Save'));\n        $this-&gt;buttonList-&gt;add(\n            'saveandcontinue',\n            &#x5B;\n                'label' =&gt; __('Save and Continue Edit'),\n                'class' =&gt; 'save',\n                'data_attribute' =&gt; &#x5B;\n                    'mage-init' =&gt; &#x5B;\n                        'button' =&gt; &#x5B;\n                            'event' =&gt; 'saveAndContinueEdit',\n                            'target' =&gt; '#edit_form'\n                        ]\n                    ]\n                ]\n            ],\n            -100\n        );\n        $this-&gt;buttonList-&gt;update('delete', 'label', __('Delete'));\n    }\n\n    \/**\n     * Retrieve text for header element depending on loaded news\n     *\n     * @return string\n     *\/\n    public function getHeaderText()\n    {\n        $posts = $this-&gt;_coreRegistry-&gt;registry('magetop_blog');\n        if ($posts-&gt;getId()) {\n            $postsTitle = $this-&gt;escapeHtml($posts-&gt;getTitle());\n            return __(&quot;Edit News '%1'&quot;, $postsTitle);\n        } else {\n            return __('Add News');\n        }\n    }\n\n    \/**\n     * Prepare layout\n     *\n     * @return \\Magento\\Framework\\View\\Element\\AbstractBlock\n     *\/\n    protected function _prepareLayout()\n    {\n        $this-&gt;_formScripts&#x5B;] = &quot;\n            function toggleEditor() {\n                if (tinyMCE.getInstanceById('post_content') == null) {\n                    tinyMCE.execCommand('mceAddControl', false, 'post_content');\n                } else {\n                    tinyMCE.execCommand('mceRemoveControl', false, 'post_content');\n                }\n            };\n        &quot;;\n\n        return parent::_prepareLayout();\n    }\n}\n<\/pre><\/div>\n\n\n<p>Next, create file Magetop\/Helloworld\/Block\/Adminhtml\/Posts\/Edit\/Tabs.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Block\\Adminhtml\\Posts\\Edit;\n\nuse Magento\\Backend\\Block\\Widget\\Tabs as WidgetTabs;\n\nclass Tabs extends WidgetTabs\n{\n    \/**\n     * Class constructor\n     *\n     * @return void\n     *\/\n    protected function _construct()\n    {\n        parent::_construct();\n        $this-&gt;setId('post_edit_tabs');\n        $this-&gt;setDestElementId('edit_form');\n        $this-&gt;setTitle(__('Post Information'));\n    }\n\n    \/**\n     * @return $this\n     *\/\n    protected function _beforeToHtml()\n    {\n        $this-&gt;addTab(\n            'post_info',\n            &#x5B;\n                'label' =&gt; __('General'),\n                'title' =&gt; __('General'),\n                'content' =&gt; $this-&gt;getLayout()-&gt;createBlock(\n                    'Magetop\\Helloworld\\Block\\Adminhtml\\Posts\\Edit\\Tab\\Info'\n                )-&gt;toHtml(),\n                'active' =&gt; true\n            ]\n        );\n\n        return parent::_beforeToHtml();\n    }\n}\n<\/pre><\/div>\n\n\n<p>You create file Magetop\/Helloworld\/Block\/Adminhtml\/Posts\/Edit\/Form.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Block\\Adminhtml\\Posts\\Edit;\n\nuse Magento\\Backend\\Block\\Widget\\Form\\Generic;\n\nclass Form extends Generic\n{\n    \/**\n     * @return $this\n     *\/\n    protected function _prepareForm()\n    {\n        \/** @var \\Magento\\Framework\\Data\\Form $form *\/\n        $form = $this-&gt;_formFactory-&gt;create(\n            &#x5B;\n                'data' =&gt; &#x5B;\n                    'id'    =&gt; 'edit_form',\n                    'action' =&gt; $this-&gt;getData('action'),\n                    'method' =&gt; 'post',\n                    'enctype' =&gt; 'multipart\/form-data'\n                ]\n            ]\n        );\n        $form-&gt;setUseContainer(true);\n        $this-&gt;setForm($form);\n\n        return parent::_prepareForm();\n    }\n}\n<\/pre><\/div>\n\n\n<p>Then, you create Info.php according to the path: Magetop\/Helloworld\/Block\/Adminhtml\/Posts\/Edit\/Tab\/Info.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Block\\Adminhtml\\Posts\\Edit\\Tab;\n\nuse Magento\\Backend\\Block\\Widget\\Form\\Generic;\nuse Magento\\Backend\\Block\\Widget\\Tab\\TabInterface;\nuse Magento\\Backend\\Block\\Template\\Context;\nuse Magento\\Framework\\Registry;\nuse Magento\\Framework\\Data\\FormFactory;\nuse Magento\\Cms\\Model\\Wysiwyg\\Config;\nuse Magetop\\Helloworld\\Model\\System\\Config\\Status;\n\nclass Info extends Generic implements TabInterface\n{\n    \/**\n     * @var \\Magento\\Cms\\Model\\Wysiwyg\\Config\n     *\/\n    protected $_wysiwygConfig;\n\n    \/**\n     * @var \\Magetop\\Helloworld\\Model\\System\\Config\\Status\n     *\/\n    protected $_status;\n    \/**\n     * @param Context $context\n     * @param Registry $registry\n     * @param FormFactory $formFactory\n     * @param Config $wysiwygConfig\n     * @param Status $status\n     * @param array $data\n     *\/\n    public function __construct(\n        Context $context,\n        Registry $registry,\n        FormFactory $formFactory,\n        Config $wysiwygConfig,\n        Status $status,\n        array $data = &#x5B;]\n    ) {\n        $this-&gt;_wysiwygConfig = $wysiwygConfig;\n        $this-&gt;_status = $status;\n        parent::__construct($context, $registry, $formFactory, $data);\n    }\n\n    \/**\n     * Prepare form fields\n     *\n     * @return \\Magento\\Backend\\Block\\Widget\\Form\n     *\/\n    protected function _prepareForm()\n    {\n        \/** @var $model \\Magetop\\Helloworld\\Model\\PostsFactory *\/\n        $model = $this-&gt;_coreRegistry-&gt;registry('magetop_blog');\n\n        \/** @var \\Magento\\Framework\\Data\\Form $form *\/\n        $form = $this-&gt;_formFactory-&gt;create();\n        $form-&gt;setHtmlIdPrefix('post_');\n        $form-&gt;setFieldNameSuffix('post');\n        \/\/ new filed\n\n        $fieldset = $form-&gt;addFieldset(\n            'base_fieldset',\n            &#x5B;'legend' =&gt; __('General')]\n        );\n\n        if ($model-&gt;getId()) {\n            $fieldset-&gt;addField(\n                'id',\n                'hidden',\n                &#x5B;'name' =&gt; 'id']\n            );\n        }\n        $fieldset-&gt;addField(\n            'title',\n            'text',\n            &#x5B;\n                'name'      =&gt; 'title',\n                'label'     =&gt; __('Title'),\n                'title' =&gt; __('Title'),\n                'required' =&gt; true\n            ]\n        );\n        $fieldset-&gt;addField(\n            'image',\n            'text',\n            array(\n                'name'      =&gt; 'image',\n                'label'     =&gt; __('Image'),\n                'title' =&gt; __('Image'),\n            )\n        );\n        $fieldset-&gt;addField(\n            'status',\n            'select',\n            &#x5B;\n                'name'      =&gt; 'status',\n                'label'     =&gt; __('Status'),\n                'options'   =&gt; $this-&gt;_status-&gt;toOptionArray()\n            ]\n        );\n        $fieldset-&gt;addField('description', 'editor', &#x5B;\n            'name'      =&gt; 'description',\n            'label'   =&gt; 'Description',\n            'config'    =&gt; $this-&gt;_wysiwygConfig-&gt;getConfig(),\n            'wysiwyg'   =&gt; true,\n            'required'  =&gt; false\n        ]);\n        $data = $model-&gt;getData();\n        $form-&gt;setValues($data);\n        $this-&gt;setForm($form);\n\n        return parent::_prepareForm();\n    }\n    \/**\n     * Prepare label for tab\n     *\n     * @return string\n     *\/\n    public function getTabLabel()\n    {\n        return __('Posts Info');\n    }\n\n    \/**\n     * Prepare title for tab\n     *\n     * @return string\n     *\/\n    public function getTabTitle()\n    {\n        return __('Posts Info');\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    public function canShowTab()\n    {\n        return true;\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    public function isHidden()\n    {\n        return false;\n    }\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Create Controller files<\/h2>\n\n\n\n<p>You create the files Edit, Delete, NewAction, Save in the Controller with the following path: Magetop\/Helloworld\/Controller\/Adminhtml\/Posts.<\/p>\n\n\n\n<p>Edit.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nuse Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nclass Edit extends Posts\n{\n    \/**\n     * @return void\n     *\/\n    public function execute()\n    {\n        $postId = $this-&gt;getRequest()-&gt;getParam('id');\n\n        $model = $this-&gt;_postsFactory-&gt;create();\n\n        if ($postId) {\n            $model-&gt;load($postId);\n            if (!$model-&gt;getId()) {\n                $this-&gt;messageManager-&gt;addError(__('This news no longer exists.'));\n                $this-&gt;_redirect('*\/*\/');\n                return;\n            }\n        }\n\n        \/\/ Restore previously entered form data from session\n        $data = $this-&gt;_session-&gt;getNewsData(true);\n        if (!empty($data)) {\n            $model-&gt;setData($data);\n        }\n        $this-&gt;_coreRegistry-&gt;register('magetop_blog', $model);\n\n        \/** @var \\Magento\\Backend\\Model\\View\\Result\\Page $resultPage *\/\n        $resultPage = $this-&gt;_resultPageFactory-&gt;create();\n        $resultPage-&gt;setActiveMenu('Magetop_Helloworld::helloworld_menu');\n        $resultPage-&gt;getConfig()-&gt;getTitle()-&gt;prepend(__('Posts'));\n\n        return $resultPage;\n    }\n}\n<\/pre><\/div>\n\n\n<p>NewAction.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nuse Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nclass NewAction extends Posts\n{\n    \/**\n     * Create new news action\n     *\n     * @return void\n     *\/\n    public function execute()\n    {\n        $this-&gt;_forward('edit');\n    }\n}\n<\/pre><\/div>\n\n\n<p>Delete.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nuse Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nclass Delete extends Posts\n{\n    public function execute()\n    {\n        $postId = (int) $this-&gt;getRequest()-&gt;getParam('id');\n\n        if ($postId) {\n            \/** @var $postModel \\Magetop\\Hellworld\\Model\\Posts *\/\n            $postModel = $this-&gt;_postsFactory-&gt;create();\n            $postModel-&gt;load($postId);\n\n            \/\/ Check this news exists or not\n            if (!$postModel-&gt;getId()) {\n                $this-&gt;messageManager-&gt;addError(__('This news no longer exists.'));\n            } else {\n                try {\n                    \/\/ Delete news\n                    $postModel-&gt;delete();\n                    $this-&gt;messageManager-&gt;addSuccess(__('The news has been deleted.'));\n\n                    \/\/ Redirect to grid page\n                    $this-&gt;_redirect('*\/*\/');\n                    return;\n                } catch (\\Exception $e) {\n                    $this-&gt;messageManager-&gt;addError($e-&gt;getMessage());\n                    $this-&gt;_redirect('*\/*\/edit', &#x5B;'id' =&gt; $postModel-&gt;getId()]);\n                }\n            }\n        }\n    }\n}\n<\/pre><\/div>\n\n\n<p>Save.php<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nuse Magetop\\Helloworld\\Controller\\Adminhtml\\Posts;\n\nclass Save extends Posts\n{\n    \/**\n     * @return void\n     *\/\n    public function execute()\n    {\n        $isPost = $this-&gt;getRequest()-&gt;getPost();\n\n        if ($isPost) {\n            $postsModel = $this-&gt;_postsFactory-&gt;create();\n            $postsId = $this-&gt;getRequest()-&gt;getParam('id');\n\n            if ($postsId) {\n                $postsModel-&gt;load($postsId);\n            }\n            $formData = $this-&gt;getRequest()-&gt;getParam('post');\n            $postsModel-&gt;setData($formData);\n\n            try {\n                \/\/ Save news\n                $postsModel-&gt;save();\n\n                \/\/ Display success message\n                $this-&gt;messageManager-&gt;addSuccess(__('The news has been saved.'));\n\n                \/\/ Check if 'Save and Continue'\n                if ($this-&gt;getRequest()-&gt;getParam('back')) {\n                    $this-&gt;_redirect('*\/*\/edit', &#x5B;'id' =&gt; $postsModel-&gt;getId(), '_current' =&gt; true]);\n                    return;\n                }\n\n                \/\/ Go to grid page\n                $this-&gt;_redirect('*\/*\/');\n                return;\n            } catch (\\Exception $e) {\n                $this-&gt;messageManager-&gt;addError($e-&gt;getMessage());\n            }\n\n            $this-&gt;_getSession()-&gt;setFormData($formData);\n            $this-&gt;_redirect('*\/*\/edit', &#x5B;'id' =&gt; $postsId]);\n        }\n    }\n}\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Create two layout<\/h2>\n\n\n\n<p>Create helloworld_posts_create.xml in Magetop\/Helloworld\/view\/adminhtml\/layout\/helloworld_posts_create.xml<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; auto-links: false; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;!--\n\/**\n * helloworld_posts_create\n *\n * @copyright Copyright \u00a9 2020 Magetop. All rights reserved.\n * @author    info@magetop.com\n *\/\n--&gt;\n&lt;layout xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;\n        xsi:noNamespaceSchemaLocation=&quot;..\/..\/..\/..\/..\/Magento\/Core\/etc\/layout_single.xsd&quot;&gt;\n    &lt;update handle=&quot;helloworld_posts_edit&quot;\/&gt;\n&lt;\/layout&gt;\n<\/pre><\/div>\n\n\n<p>Create helloworld_posts_edit.xml in Magetop\/Helloworld\/view\/adminhtml\/layout\/helloworld_posts_edit.xml<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; auto-links: false; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;!--\n\/**\n * helloworld_posts_edit\n *\n * @copyright Copyright \u00a9 2020 Magetop. All rights reserved.\n * @author    info@magetop.com\n *\/\n--&gt;\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; layout=&quot;admin-2columns-left&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;body&gt;\n        &lt;referenceContainer name=&quot;left&quot;&gt;\n            &lt;block class=&quot;Magetop\\Helloworld\\Block\\Adminhtml\\Posts\\Edit\\Tabs&quot;\n                   name=&quot;helloworld_posts_grid_block.edit.tabs&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n        &lt;referenceContainer name=&quot;content&quot;&gt;\n            &lt;block class=&quot;Magetop\\Helloworld\\Block\\Adminhtml\\Posts\\Edit&quot;\n                   name=&quot;helloworld_posts_grid_block.edit&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;\n<\/pre><\/div>\n\n\n<p>You access in Magento Admin Panel and check it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1779\" height=\"760\" data-attachment-id=\"1735\" data-permalink=\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/check-in-admin-panel\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?fit=1779%2C760&amp;ssl=1\" data-orig-size=\"1779,760\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"check-in-admin-panel\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?fit=300%2C128&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?fit=800%2C341&amp;ssl=1\" src=\"https:\/\/i2.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?fit=800%2C341&amp;ssl=1\" alt=\"check grid in admin panel\" class=\"wp-image-1735\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?w=1779&amp;ssl=1 1779w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?resize=300%2C128&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?resize=1024%2C437&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?resize=768%2C328&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?resize=1536%2C656&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/check-in-admin-panel.png?w=1600&amp;ssl=1 1600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1763\" height=\"855\" data-attachment-id=\"1736\" data-permalink=\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/add-new-items-in-admin-panel\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?fit=1763%2C855&amp;ssl=1\" data-orig-size=\"1763,855\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"add-new-items-in-admin-panel\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?fit=300%2C145&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?fit=800%2C388&amp;ssl=1\" src=\"https:\/\/i1.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?fit=800%2C388&amp;ssl=1\" alt=\"add new items in admin panel\" class=\"wp-image-1736\" srcset=\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?w=1763&amp;ssl=1 1763w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?resize=300%2C145&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?resize=1024%2C497&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?resize=768%2C372&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?resize=1536%2C745&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/add-new-items-in-admin-panel.png?w=1600&amp;ssl=1 1600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>I hope through this series you can create your own complete module. Good luck!<\/p>\n\n\n\n<p>In addition to Admin Grid CRUD In Magento 2, you can read the articles <a href=\"https:\/\/www.magetop.com\/blog\/how-to-create-new-theme-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Create New Theme In Magento 2<\/a>.<\/p>\n\n\n\n<p>Follow us for the more helpful article!<\/p>\n\n\n\n<p>We hope this is a useful series for you.<\/p>\n\n\n\n<p>Thank you for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous article, I introduced How To Add Mass Actions In Magento 2. In this article, we will learn about Admin Grid CRUD In Magento 2.<br \/>\nThis is a series on Magento 2 Extension Tutorial. The lessons are related to each other so you should read step by step.<\/p>\n","protected":false},"author":106,"featured_media":1752,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[366,368,367,107],"class_list":["post-1722","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-magento-2-tutorials","tag-admin-grid-crud-in-magento-2","tag-grid-and-form-in-magento-2-admin-panel","tag-how-to-add-update-item-in-magento-backend","tag-magento-2-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Admin Grid CRUD In Magento 2 - Magetop Blog Tutorial<\/title>\n<meta name=\"description\" content=\"In the previous article, I introduced How To Add Mass Actions In Magento 2. In this article, we will learn about Admin Grid CRUD In Magento 2.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Admin Grid CRUD In Magento 2 - Magetop Blog Tutorial\" \/>\n<meta property=\"og:description\" content=\"In the previous article, I introduced How To Add Mass Actions In Magento 2. In this article, we will learn about Admin Grid CRUD In Magento 2.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/\" \/>\n<meta property=\"og:site_name\" content=\"Magetop Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/MagetopStore\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-02T11:29:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-22T02:55:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i1.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"445\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Aaron LX\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:site\" content=\"@MagetopStore\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Aaron LX\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/\"},\"author\":{\"name\":\"Aaron LX\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7\"},\"headline\":\"Admin Grid CRUD In Magento 2\",\"datePublished\":\"2020-04-02T11:29:23+00:00\",\"dateModified\":\"2021-07-22T02:55:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/\"},\"wordCount\":253,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1\",\"keywords\":[\"Admin Grid CRUD In Magento 2\",\"Grid and Form in Magento 2 Admin Panel\",\"How to add\/update item in Magento backend\",\"magento 2 tutorials\"],\"articleSection\":[\"Magento 2 Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/\",\"url\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/\",\"name\":\"Admin Grid CRUD In Magento 2 - Magetop Blog Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1\",\"datePublished\":\"2020-04-02T11:29:23+00:00\",\"dateModified\":\"2021-07-22T02:55:56+00:00\",\"description\":\"In the previous article, I introduced How To Add Mass Actions In Magento 2. In this article, we will learn about Admin Grid CRUD In Magento 2.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1\",\"width\":750,\"height\":445,\"caption\":\"Magento 2 Admin Grid CRUD\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.magetop.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Admin Grid CRUD In Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#website\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"name\":\"Magetop Blog\",\"description\":\"Exploring Magento Tips, Tricks, and Trends\",\"publisher\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.magetop.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#organization\",\"name\":\"Magetop.com\",\"url\":\"https:\/\/www.magetop.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1\",\"width\":475,\"height\":475,\"caption\":\"Magetop.com\"},\"image\":{\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/MagetopStore\",\"https:\/\/x.com\/MagetopStore\",\"https:\/\/www.linkedin.com\/company\/magetop\",\"https:\/\/www.pinterest.com\/magetop\",\"https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7\",\"name\":\"Aaron LX\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1\",\"caption\":\"Aaron LX\"},\"description\":\"Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.\",\"url\":\"https:\/\/www.magetop.com\/blog\/author\/aaron-lx\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Admin Grid CRUD In Magento 2 - Magetop Blog Tutorial","description":"In the previous article, I introduced How To Add Mass Actions In Magento 2. In this article, we will learn about Admin Grid CRUD In Magento 2.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/","og_locale":"en_US","og_type":"article","og_title":"Admin Grid CRUD In Magento 2 - Magetop Blog Tutorial","og_description":"In the previous article, I introduced How To Add Mass Actions In Magento 2. In this article, we will learn about Admin Grid CRUD In Magento 2.","og_url":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/","og_site_name":"Magetop Blog","article_publisher":"https:\/\/www.facebook.com\/MagetopStore","article_published_time":"2020-04-02T11:29:23+00:00","article_modified_time":"2021-07-22T02:55:56+00:00","og_image":[{"width":750,"height":445,"url":"https:\/\/i1.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1","type":"image\/png"}],"author":"Aaron LX","twitter_card":"summary_large_image","twitter_creator":"@MagetopStore","twitter_site":"@MagetopStore","twitter_misc":{"Written by":"Aaron LX","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#article","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/"},"author":{"name":"Aaron LX","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7"},"headline":"Admin Grid CRUD In Magento 2","datePublished":"2020-04-02T11:29:23+00:00","dateModified":"2021-07-22T02:55:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/"},"wordCount":253,"commentCount":7,"publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1","keywords":["Admin Grid CRUD In Magento 2","Grid and Form in Magento 2 Admin Panel","How to add\/update item in Magento backend","magento 2 tutorials"],"articleSection":["Magento 2 Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/","url":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/","name":"Admin Grid CRUD In Magento 2 - Magetop Blog Tutorial","isPartOf":{"@id":"https:\/\/www.magetop.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1","datePublished":"2020-04-02T11:29:23+00:00","dateModified":"2021-07-22T02:55:56+00:00","description":"In the previous article, I introduced How To Add Mass Actions In Magento 2. In this article, we will learn about Admin Grid CRUD In Magento 2.","breadcrumb":{"@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#primaryimage","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1","width":750,"height":445,"caption":"Magento 2 Admin Grid CRUD"},{"@type":"BreadcrumbList","@id":"https:\/\/www.magetop.com\/blog\/admin-grid-crud-in-magento\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.magetop.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Admin Grid CRUD In Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/www.magetop.com\/blog\/#website","url":"https:\/\/www.magetop.com\/blog\/","name":"Magetop Blog","description":"Exploring Magento Tips, Tricks, and Trends","publisher":{"@id":"https:\/\/www.magetop.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.magetop.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.magetop.com\/blog\/#organization","name":"Magetop.com","url":"https:\/\/www.magetop.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2021\/11\/logo.png?fit=475%2C475&ssl=1","width":475,"height":475,"caption":"Magetop.com"},"image":{"@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/MagetopStore","https:\/\/x.com\/MagetopStore","https:\/\/www.linkedin.com\/company\/magetop","https:\/\/www.pinterest.com\/magetop","https:\/\/www.youtube.com\/channel\/UCXoiJsz88OfPmwa8QpUkwOA"]},{"@type":"Person","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/b8770690a02cc53a273d6b7205229ff7","name":"Aaron LX","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.magetop.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2025\/11\/475315059_122137709240563546_260104055231757176_n.jpg?fit=96%2C96&#038;ssl=1","caption":"Aaron LX"},"description":"Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.","url":"https:\/\/www.magetop.com\/blog\/author\/aaron-lx\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-Admin-Grid-CRUD.png?fit=750%2C445&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/paOdw5-rM","jetpack-related-posts":[{"id":1402,"url":"https:\/\/www.magetop.com\/blog\/magento-2-extension-tutorial\/","url_meta":{"origin":1722,"position":0},"title":"Magento 2 Extension Tutorial","author":"Aaron LX","date":"February 15, 2020","format":false,"excerpt":"Magento 2 is an open-source platform that allows you can create a module for yourself. And those modules can extend functions for the Magento store. And in this article, I will introduce to Magento 2 Extension Tutorial.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Magetop Extension Tutorial","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/02\/Extension-Tutorial.jpg?fit=750%2C455&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/02\/Extension-Tutorial.jpg?fit=750%2C455&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/02\/Extension-Tutorial.jpg?fit=750%2C455&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/02\/Extension-Tutorial.jpg?fit=750%2C455&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1709,"url":"https:\/\/www.magetop.com\/blog\/how-to-add-mass-actions-in-magento\/","url_meta":{"origin":1722,"position":1},"title":"How To Add Mass Actions In Magento 2","author":"Aaron LX","date":"April 2, 2020","format":false,"excerpt":"In the previous lesson, I showed you How To Custom Admin Grid In Magento 2. Following that lesson, I will show you How To Add Mass Actions In Magento 2. This is a series on Magento 2 Extension Tutorial. The lessons are related to each other so you should read\u2026","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Magento 2 How To Add Mass Action","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Add-Mass-Action.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Add-Mass-Action.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Add-Mass-Action.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Add-Mass-Action.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1696,"url":"https:\/\/www.magetop.com\/blog\/how-to-custom-admin-grid-in-magento\/","url_meta":{"origin":1722,"position":2},"title":"How To Custom Admin Grid In Magento 2","author":"Aaron LX","date":"April 2, 2020","format":false,"excerpt":"In the previous lesson, I introduced How To Create Admin Grid In Magento 2. You should read that lesson to be able to do How To Custom Admin Grid In Magento 2 lesson.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Magento 2 How To Custom Admin Grid","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Custom-Admin-Grid.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Custom-Admin-Grid.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Custom-Admin-Grid.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Custom-Admin-Grid.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1640,"url":"https:\/\/www.magetop.com\/blog\/how-to-use-model-in-magento-2\/","url_meta":{"origin":1722,"position":3},"title":"How To Use Model In Magento 2","author":"Aaron LX","date":"April 1, 2020","format":false,"excerpt":"In this tutorial, we will learn about How To Use Model in Magento 2. This is a basic tutorial followed by How To Create Database Table in Magento 2. You should see the previous article to understand this lesson.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Magento 2 How To Use Model","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Model.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Model.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Model.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Model.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1685,"url":"https:\/\/www.magetop.com\/blog\/how-to-create-admin-grid-in-magento\/","url_meta":{"origin":1722,"position":4},"title":"How To Create Admin Grid In Magento 2","author":"Aaron LX","date":"April 2, 2020","format":false,"excerpt":"In this lesson, I will show you How To Create Admin Grid In Magento 2. This is a very important lesson, but don't forget to refer to the previous article: How To Use Event In Magento 2. You should read the Magento 2 Extension Tutorial step by step.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Magento 2 How To Create Admin Grid","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Create-Admin-Grid.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Create-Admin-Grid.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Create-Admin-Grid.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Create-Admin-Grid.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1651,"url":"https:\/\/www.magetop.com\/blog\/how-to-use-event-in-magento-2\/","url_meta":{"origin":1722,"position":5},"title":"How To Use Event In Magento 2","author":"Aaron LX","date":"April 1, 2020","format":false,"excerpt":"In the previous article, we learned How To Use Helper And Setting In Magento 2. Following the previous tutorial, we will learn about How To Use Event in Magento 2. This is a very basic tutorial but it is very important.","rel":"","context":"In &quot;Magento 2 Tutorials&quot;","block_context":{"text":"Magento 2 Tutorials","link":"https:\/\/www.magetop.com\/blog\/magento-2-tutorials\/"},"img":{"alt_text":"Magento 2 How To Use Event","src":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Event.png?fit=750%2C445&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Event.png?fit=750%2C445&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Event.png?fit=750%2C445&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.magetop.com\/blog\/wp-content\/uploads\/2020\/04\/Magento-2-How-To-Use-Event.png?fit=750%2C445&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/1722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/users\/106"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/comments?post=1722"}],"version-history":[{"count":3,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/1722\/revisions"}],"predecessor-version":[{"id":2374,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/posts\/1722\/revisions\/2374"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media\/1752"}],"wp:attachment":[{"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/media?parent=1722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/categories?post=1722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magetop.com\/blog\/wp-json\/wp\/v2\/tags?post=1722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}