{"id":284521,"date":"2021-05-28T05:09:52","date_gmt":"2021-05-28T05:09:52","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=284521"},"modified":"2024-07-26T12:20:58","modified_gmt":"2024-07-26T12:20:58","slug":"magento-development-16-action-column","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/","title":{"rendered":"Magento 2 Development 19: Action Column"},"content":{"rendered":"\n<p>In the previous blog, we have seen about Mass-actions but sometimes we will need actions for each row. For example, if we want to give permission to the admin to edit the blogs then we will have to give an edit link in each row; just like we did on front-end. <\/p>\n\n\n\n<p>In this blog, we will create an action column that will allow us to delete a single blog at a time. We will look into the edit blog feature in the next blog.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create UI-Component file<\/h3>\n\n\n\n<p>Since we are adding a column in the grid, at first we need to edit the ui-component file of the grid <em>view\/adminhtml\/ui_component\/blogmanager_blog_listing.xml<\/em><\/p>\n\n\n\n<p>Updated code for <em>view\/adminhtml\/ui_component\/blogmanager_blog_listing.xml<\/em> file<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;listing xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n    &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n        &lt;item name=&quot;js_config&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;provider&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_listing.blogmanager_blog_listing_data_source&lt;\/item&gt;\n            &lt;item name=&quot;deps&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_listing.blogmanager_blog_listing_data_source&lt;\/item&gt;\n        &lt;\/item&gt;\n        &lt;item name=&quot;spinner&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_columns&lt;\/item&gt;\n    &lt;\/argument&gt;\n    &lt;dataSource name=&quot;blogmanager_blog_listing_data_source&quot;&gt;\n        &lt;argument name=&quot;dataProvider&quot; xsi:type=&quot;configurableObject&quot;&gt;\n            &lt;argument name=&quot;class&quot; xsi:type=&quot;string&quot;&gt;Magento\\Framework\\View\\Element\\UiComponent\\DataProvider\\DataProvider&lt;\/argument&gt;\n            &lt;argument name=&quot;name&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_listing_data_source&lt;\/argument&gt;\n            &lt;argument name=&quot;primaryFieldName&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/argument&gt;\n            &lt;argument name=&quot;requestFieldName&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/argument&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;update_url&quot; xsi:type=&quot;url&quot; path=&quot;mui\/index\/render&quot;\/&gt;\n                &lt;item name=&quot;storageConfig&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                &lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/argument&gt;\n        &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;js_config&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Magento_Ui\/js\/grid\/provider&lt;\/item&gt;\n            &lt;\/item&gt;\n        &lt;\/argument&gt;\n    &lt;\/dataSource&gt;\n    &lt;listingToolbar name=&quot;listing_top&quot;&gt;\n        &lt;massaction name=&quot;listing_massaction&quot; component=&quot;Magento_Ui\/js\/grid\/tree-massactions&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;selectProvider&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_listing.blogmanager_blog_listing.blogmanager_blog_columns.ids&lt;\/item&gt;\n                &lt;item name=&quot;displayArea&quot; xsi:type=&quot;string&quot;&gt;bottom&lt;\/item&gt;\n                &lt;item name=&quot;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;action name=&quot;delete&quot;&gt;\n                &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;type&quot; xsi:type=&quot;string&quot;&gt;delete&lt;\/item&gt;\n                    &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Delete&lt;\/item&gt;\n                    &lt;item name=&quot;url&quot; xsi:type=&quot;url&quot; path=&quot;blog\/manage\/massDelete&quot;\/&gt;\n                    &lt;item name=&quot;confirm&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;title&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Delete Blogs?&lt;\/item&gt;\n                        &lt;item name=&quot;message&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Are you sure you want to delete the selected blogs?&lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/item&gt;\n                &lt;\/argument&gt;\n            &lt;\/action&gt;\n            &lt;action name=&quot;status&quot;&gt;\n                &lt;settings&gt;\n                    &lt;type&gt;status&lt;\/type&gt;\n                    &lt;label translate=&quot;true&quot;&gt;Change status&lt;\/label&gt;\n                    &lt;actions&gt;\n                        &lt;action name=&quot;0&quot;&gt;\n                            &lt;type&gt;enable&lt;\/type&gt;\n                            &lt;label translate=&quot;true&quot;&gt;Enable&lt;\/label&gt;\n                            &lt;url path=&quot;blog\/manage\/massStatus&quot;&gt;\n                                &lt;param name=&quot;status&quot;&gt;1&lt;\/param&gt;\n                            &lt;\/url&gt;\n                        &lt;\/action&gt;\n                        &lt;action name=&quot;1&quot;&gt;\n                            &lt;type&gt;disable&lt;\/type&gt;\n                            &lt;label translate=&quot;true&quot;&gt;Disable&lt;\/label&gt;\n                            &lt;url path=&quot;blog\/manage\/massStatus&quot;&gt;\n                                &lt;param name=&quot;status&quot;&gt;0&lt;\/param&gt;\n                            &lt;\/url&gt;\n                        &lt;\/action&gt;\n                    &lt;\/actions&gt;\n                &lt;\/settings&gt;\n            &lt;\/action&gt;\n        &lt;\/massaction&gt;\n        &lt;bookmark name=&quot;bookmarks&quot;\/&gt;\n        &lt;columnsControls name=&quot;columns_controls&quot;\/&gt;\n        &lt;filters name=&quot;listing_filters&quot;&gt;\n                &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;templates&quot; xsi:type=&quot;array&quot;&gt;\n                            &lt;item name=&quot;filters&quot; xsi:type=&quot;array&quot;&gt;\n                                &lt;item name=&quot;select&quot; xsi:type=&quot;array&quot;&gt;\n                                    &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Magento_Ui\/js\/form\/element\/ui-select&lt;\/item&gt;\n                                    &lt;item name=&quot;template&quot; xsi:type=&quot;string&quot;&gt;ui\/grid\/filters\/elements\/ui-select&lt;\/item&gt;\n                                &lt;\/item&gt;\n                            &lt;\/item&gt;\n                        &lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/argument&gt;\n        &lt;\/filters&gt;\n        &lt;paging name=&quot;listing_paging&quot;\/&gt;\n    &lt;\/listingToolbar&gt;\n    &lt;columns name=&quot;blogmanager_blog_columns&quot;&gt;\n        &lt;selectionsColumn name=&quot;ids&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/selectionsColumn&gt;\n        &lt;column name=&quot;entity_id&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;textRange&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;ID&lt;\/label&gt;\n                &lt;resizeDefaultWidth&gt;25&lt;\/resizeDefaultWidth&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;user_name&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;text&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;User&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;title&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;text&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;Title&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;content&quot; class=&quot;Webkul\\BlogManager\\Ui\\Component\\Listing\\Columns\\Content&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;false&lt;\/filter&gt;\n                &lt;sortable&gt;false&lt;\/sortable&gt;\n                &lt;label translate=&quot;true&quot;&gt;Content&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;status&quot; component=&quot;Magento_Ui\/js\/grid\/columns\/select&quot;&gt;\n            &lt;settings&gt;\n                &lt;options class=&quot;Webkul\\BlogManager\\Model\\Blog\\Status&quot;\/&gt;\n                &lt;dataType&gt;select&lt;\/dataType&gt;\n                &lt;filter&gt;select&lt;\/filter&gt;\n                &lt;sortable&gt;false&lt;\/sortable&gt;\n                &lt;label translate=&quot;true&quot;&gt;Status&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;updated_at&quot; component=&quot;Magento_Ui\/js\/grid\/columns\/date&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;dateRange&lt;\/filter&gt;\n                &lt;dataType&gt;date&lt;\/dataType&gt;\n                &lt;label translate=&quot;true&quot;&gt;Updated&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;created_at&quot; component=&quot;Magento_Ui\/js\/grid\/columns\/date&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;dateRange&lt;\/filter&gt;\n                &lt;dataType&gt;date&lt;\/dataType&gt;\n                &lt;label translate=&quot;true&quot;&gt;Created&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;actionsColumn name=&quot;delete_action&quot; class=&quot;Webkul\\BlogManager\\Ui\\Component\\Listing\\Columns\\DeleteAction&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                    &lt;item name=&quot;viewUrlPath&quot; xsi:type=&quot;string&quot;&gt;blogmanager\/manage\/delete&lt;\/item&gt;\n                    &lt;item name=&quot;urlEntityParamName&quot; xsi:type=&quot;string&quot;&gt;id&lt;\/item&gt;\n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;50&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;settings&gt;\n                &lt;label translate=&quot;true&quot;&gt;Delete&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/actionsColumn&gt;\n    &lt;\/columns&gt;\n&lt;\/listing&gt;<\/pre>\n\n\n\n<p>Here, at the end, I have added a new tag <code><strong>actionsColumn<\/strong><\/code> to add the action column which will let us delete a single row at a time. We have used a class for this column. With that class, we will be displaying the URLs for each row.<\/p>\n\n\n\n<p>With the argument tag, we can pass some data to the class. It will get clear when we see the code for the DeleteAction class. <\/p>\n\n\n\n<p>NOTE that here for the url we are using the route id instead of the front name. It&#8217;s because of some strange issue with Magento. So please keep both the route id and the front name the same when you are developing any module.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create Action Column<\/h3>\n\n\n\n<p>Now let&#8217;s create the class of the action column, <em>Ui\/Component\/Listing\/Columns\/DeleteAction.php<\/em><\/p>\n\n\n\n<p>Code for <em>Ui\/Component\/Listing\/Columns\/DeleteAction.php<\/em> file<\/p>\n\n\n\n<p>Just like we did earlier with the <em>Content<\/em> column where we used <strong>prepareDataSource<\/strong> to loop through each row and set the data for each row. We have looped over <em><code>$dataSource['data']['items']<\/code><\/em> and we are setting url data for each row as <em>[ &#8216;view&#8217; => [ &#8216;href&#8217; => &#8216;#&#8217;, &#8216;label&#8217; => &#8216;Link&#8217; ] ];<\/em> format. <\/p>\n\n\n\n<p>Here you can notice that we have used the <em>getData <\/em>function. So what it does is that it allows us to get the values that we passed from the ui component in the <em>argument<\/em> tag.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Ui\\Component\\Listing\\Columns;\n\nuse Magento\\Framework\\UrlInterface;\nuse Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface;\nuse Magento\\Framework\\View\\Element\\UiComponentFactory;\n\nclass DeleteAction extends \\Magento\\Ui\\Component\\Listing\\Columns\\Column\n{\n    \/**\n     * @var Magento\\Framework\\UrlInterface\n     *\/\n    protected $urlBuilder;\n\n    \/**\n     * Dependency Initilization\n     *\n     * @param ContextInterface $context\n     * @param UiComponentFactory $uiComponentFactory\n     * @param UrlInterface $urlBuilder\n     * @param array $components\n     * @param array $data\n     *\/\n    public function __construct(\n        ContextInterface $context,\n        UiComponentFactory $uiComponentFactory,\n        UrlInterface $urlBuilder,\n        array $components = &#091;],\n        array $data = &#091;]\n    ) {\n        $this-&gt;urlBuilder = $urlBuilder;\n        parent::__construct($context, $uiComponentFactory, $components, $data);\n    }\n\n    \/**\n     * Prepare Data Source\n     *\n     * @param array $dataSource\n     * @return array\n     *\/\n    public function prepareDataSource(array $dataSource)\n    {\n        if (isset($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;])) {\n            foreach ($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;] as &amp;$item) {\n                if (isset($item&#091;&#039;entity_id&#039;])) {\n                    $viewUrlPath = $this-&gt;getData(&#039;config\/viewUrlPath&#039;);\n                    $urlEntityParamName = $this-&gt;getData(&#039;config\/urlEntityParamName&#039;);\n                    $item&#091;$this-&gt;getData(&#039;name&#039;)] = &#091;\n                        &#039;view&#039; =&gt; &#091;\n                            &#039;href&#039; =&gt; $this-&gt;urlBuilder-&gt;getUrl(\n                                $viewUrlPath,\n                                &#091;\n                                    $urlEntityParamName =&gt; $item&#091;&#039;entity_id&#039;],\n                                ]\n                            ),\n                            &#039;label&#039; =&gt; __(&#039;Delete&#039;),\n                        ],\n                    ];\n                }\n            }\n        }\n        return $dataSource;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Create Controller file<\/h3>\n\n\n\n<p>Now let&#8217;s create the controller which will handle the delete action <em>Controller\/Adminhtml\/Manage\/Delete.php<\/em><\/p>\n\n\n\n<p>Code for <em>Controller\/Adminhtml\/Manage\/Delete.php<\/em> file<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Controller\\Adminhtml\\Manage;\n\nuse Magento\\Backend\\App\\Action;\nuse Magento\\Backend\\App\\Action\\Context;\n\nclass Delete extends Action\n{\n    \/**\n     * @var \\Webkul\\BlogManager\\Model\\BlogFactory\n     *\/\n    protected $blogFactory;\n    \n    \/**\n     * Dependency Initilization\n     *\n     * @param Context $context\n     * @param \\Webkul\\BlogManager\\Model\\BlogFactory $blogFactory\n     *\/\n    public function __construct(\n        Context $context,\n        \\Webkul\\BlogManager\\Model\\BlogFactory $blogFactory\n    ) {\n        $this-&gt;blogFactory = $blogFactory;\n        parent::__construct($context);\n    }\n\n    \/**\n     * Provides content\n     *\n     * @return Magento\\Framework\\Controller\\Result\\Redirect\n     *\/\n    public function execute()\n    {\n        $resultRedirect = $this-&gt;resultRedirectFactory-&gt;create();\n        $id = $this-&gt;getRequest()-&gt;getParam(&#039;id&#039;);\n        try {\n            $blogModel = $this-&gt;blogFactory-&gt;create();\n            $blogModel-&gt;load($id);\n            $blogModel-&gt;delete();\n            $this-&gt;messageManager-&gt;addSuccessMessage(__(&#039;You deleted the blog.&#039;));\n        } catch (\\Exception $e) {\n            $this-&gt;messageManager-&gt;addErrorMessage($e-&gt;getMessage());\n        }\n        return $resultRedirect-&gt;setPath(&#039;*\/*\/&#039;);\n    }\n\n    \/**\n     * Check Autherization\n     *\n     * @return boolean\n     *\/\n    public function _isAllowed()\n    {\n        return $this-&gt;_authorization-&gt;isAllowed(&#039;Webkul_BlogManager::delete&#039;);\n    }\n}<\/pre>\n\n\n\n<p>I don&#8217;t think I have to explain anything in this code. Because we have already seen similar code in one blog or another. Here we have got the id from the param and loaded the blog model based on the id. Then we deleted that blog.<\/p>\n\n\n\n<p>After deleting we have redirected back to the blog listing page. And we have also used the message manager to show the success message or error message in case some exception occurs.<\/p>\n\n\n\n<p>Now when you view the grid, you should be able to see the delete column and perform the delete action using that.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"420\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif\" alt=\"Visual working\" class=\"wp-image-290488\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Next Blog -&gt; <a href=\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\">Magento 2 Development 20: uiComponent form<\/a><\/p>\n\n\n\n<p>Previous Blog -&gt;&nbsp;<a href=\"https:\/\/webkul.com\/blog\/magento-development-15-massaction\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Development 18: MassAction<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous blog, we have seen about Mass-actions but sometimes we will need actions for each row. For example, if we want to give permission to the admin to edit the blogs then we will have to give an edit link in each row; just like we did on front-end. In this blog, we <a href=\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":201,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[2070],"class_list":["post-284521","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-magento2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 2 Development 19: Action Column - Webkul Blog<\/title>\n<meta name=\"description\" content=\"we will create an action column that will allow us to delete a single blog at a time\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2 Development 19: Action Column - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"we will create an action column that will allow us to delete a single blog at a time\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-28T05:09:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-26T12:20:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif\" \/>\n<meta name=\"author\" content=\"Sanjay Chouhan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sanjay Chouhan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\"},\"author\":{\"name\":\"Sanjay Chouhan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462\"},\"headline\":\"Magento 2 Development 19: Action Column\",\"datePublished\":\"2021-05-28T05:09:52+00:00\",\"dateModified\":\"2024-07-26T12:20:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\"},\"wordCount\":498,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif\",\"keywords\":[\"Magento2\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\",\"url\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\",\"name\":\"Magento 2 Development 19: Action Column - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif\",\"datePublished\":\"2021-05-28T05:09:52+00:00\",\"dateModified\":\"2024-07-26T12:20:58+00:00\",\"description\":\"we will create an action column that will allow us to delete a single blog at a time\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif\",\"width\":800,\"height\":420},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Magento 2 Development 19: Action Column\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462\",\"name\":\"Sanjay Chouhan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Sanjay Chouhan\"},\"sameAs\":[\"https:\/\/www.instagram.com\/sanjaychouhansc\/\",\"https:\/\/in.linkedin.com\/in\/scchouhansanjay\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/sanjay-chouhan180\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento 2 Development 19: Action Column - Webkul Blog","description":"we will create an action column that will allow us to delete a single blog at a time","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:\/\/webkul.com\/blog\/magento-development-16-action-column\/","og_locale":"en_US","og_type":"article","og_title":"Magento 2 Development 19: Action Column - Webkul Blog","og_description":"we will create an action column that will allow us to delete a single blog at a time","og_url":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-05-28T05:09:52+00:00","article_modified_time":"2024-07-26T12:20:58+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif","type":"","width":"","height":""}],"author":"Sanjay Chouhan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Sanjay Chouhan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/"},"author":{"name":"Sanjay Chouhan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462"},"headline":"Magento 2 Development 19: Action Column","datePublished":"2021-05-28T05:09:52+00:00","dateModified":"2024-07-26T12:20:58+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/"},"wordCount":498,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif","keywords":["Magento2"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/","url":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/","name":"Magento 2 Development 19: Action Column - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif","datePublished":"2021-05-28T05:09:52+00:00","dateModified":"2024-07-26T12:20:58+00:00","description":"we will create an action column that will allow us to delete a single blog at a time","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/magento-development-16-action-column\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/05\/ezgif.com-gif-maker-3.gif","width":800,"height":420},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Magento 2 Development 19: Action Column"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462","name":"Sanjay Chouhan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Sanjay Chouhan"},"sameAs":["https:\/\/www.instagram.com\/sanjaychouhansc\/","https:\/\/in.linkedin.com\/in\/scchouhansanjay"],"url":"https:\/\/webkul.com\/blog\/author\/sanjay-chouhan180\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/284521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/201"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=284521"}],"version-history":[{"count":9,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/284521\/revisions"}],"predecessor-version":[{"id":455030,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/284521\/revisions\/455030"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=284521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=284521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=284521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}