{"id":305247,"date":"2021-09-12T17:56:05","date_gmt":"2021-09-12T17:56:05","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=305247"},"modified":"2024-07-24T14:05:37","modified_gmt":"2024-07-24T14:05:37","slug":"fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/","title":{"rendered":"Fix category grid issue due to children_count column in custom UI component Form"},"content":{"rendered":"\n<p>In this blog, we are going to learn how we can create a category grid in the UI component form in the admin section.<br><\/p>\n\n\n\n<p>In Magento 2, when we create a grid in the UI component form, we extend <strong>\\Magento\\Backend\\Block\\Widget\\Grid\\Extended<\/strong> Class in our custom grid Class.<\/p>\n\n\n\n<p>When you will create a category grid for the UI component form, if you fetch complete data from &#8220;catalog_category_entity&#8221;, you can face following issue(refer to the following image):<\/p>\n\n\n\n<p><strong>Error: <\/strong><em>Warning: Invalid argument supplied for foreach() in \/vendor\/magento\/module-backend\/view\/adminhtml\/templates\/widget\/grid\/extended.phtml on line 247<br>Exception in \/vendor\/magento\/framework\/App\/ErrorHandler.php:61<\/em><\/p>\n\n\n\n<p><br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"446\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png\" alt=\"categorygridError\" class=\"wp-image-305248\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-300x112.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-250x93.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-768x286.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1536x571.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError.png 1809w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>This issue occurs due to a conflict of the &#8220;children_count&#8221; column, which will get in category collection results.<\/p>\n\n\n\n<p>So, if you don&#8217;t need this &#8220;children_count&#8221; column, then you will have the need to remove this column from the collection. <br><br>So, you have to need to follow the below steps to generate the collection according to your need:<br><br>1. Get all categories using the following code:<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">$collection = $this-&gt;categoryFactory-&gt;create()\n            -&gt;getCollection()\n            -&gt;addAttributeToSelect(&#039;*&#039;);<\/pre>\n\n\n\n<p>Here, the query will be as following:<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">SELECT `e`.* FROM `catalog_category_entity` AS `e`<\/pre>\n\n\n\n<p>If you will execute this query in the database, the result will be as following:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"413\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult1-1200x413.png\" alt=\"SQLResult1\" class=\"wp-image-305251\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult1-1200x413.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult1-300x103.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult1-250x86.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult1-768x265.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult1.png 1396w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>2. Now reset columns of collection, and set columns which you want. Here, I have reset all columns and set only the &#8220;entity_id&#8221; column.<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">$collection-&gt;getSelect()\n            -&gt;reset(\\Zend_Db_Select::COLUMNS)\n            -&gt;columns(&#091;&#039;entity_id&#039;]);<\/pre>\n\n\n\n<p>Now, the query will be as following:<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">SELECT `e`.`entity_id` FROM `catalog_category_entity` AS `e`<\/pre>\n\n\n\n<p>If you will execute this query in database, result will be as following:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1135\" height=\"493\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult2.png\" alt=\"SQLResult2\" class=\"wp-image-305252\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult2.png 1135w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult2-300x130.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult2-250x109.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult2-768x334.png 768w\" sizes=\"(max-width: 1135px) 100vw, 1135px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>3. As I have to display category names in the grid, so I have added the following statement in the collection query.<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">$collection-&gt;addAttributeToSelect(&#039;*&#039;)\n            -&gt;addFieldToFilter(&#039;name&#039;, &#091;&quot;neq&quot;=&gt;null])\n            -&gt;addFieldToFilter(&#039;is_active&#039;, 1);<\/pre>\n\n\n\n<p>Now, the query will be as following:<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">SELECT `e`.`entity_id`, IF(at_name.value_id &gt; 0, at_name.value, at_name_default.value) AS `name`, \nIF(at_is_active.value_id &gt; 0, at_is_active.value, at_is_active_default.value) AS `is_active` \nFROM `catalog_category_entity` AS `e` LEFT JOIN `catalog_category_entity_varchar` AS `at_name_default` \nON (`at_name_default`.`entity_id` = `e`.`entity_id`) AND (`at_name_default`.`attribute_id` = &#039;45&#039;) AND \n`at_name_default`.`store_id` = 0 LEFT JOIN `catalog_category_entity_varchar` AS `at_name` \nON (`at_name`.`entity_id` = `e`.`entity_id`) AND (`at_name`.`attribute_id` = &#039;45&#039;) AND (`at_name`.`store_id` = 1) \nLEFT JOIN `catalog_category_entity_int` AS `at_is_active_default` \nON (`at_is_active_default`.`entity_id` = `e`.`entity_id`) AND (`at_is_active_default`.`attribute_id` = &#039;46&#039;) \nAND `at_is_active_default`.`store_id` = 0 LEFT JOIN `catalog_category_entity_int` AS `at_is_active` \nON (`at_is_active`.`entity_id` = `e`.`entity_id`) AND (`at_is_active`.`attribute_id` = &#039;46&#039;) \nAND (`at_is_active`.`store_id` = 1) WHERE (IF(at_name.value_id &gt; 0, at_name.value, at_name_default.value) != &#039;&#039;) \nAND (IF(at_is_active.value_id &gt; 0, at_is_active.value, at_is_active_default.value) = &#039;1&#039;)<\/pre>\n\n\n\n<p>If you will execute this query in database, result will be as following:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"614\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult3-1200x614.png\" alt=\"SQLResult3\" class=\"wp-image-305253\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult3-1200x614.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult3-300x154.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult3-250x128.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult3-768x393.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/SQLResult3.png 1360w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>4. Now, check the complete code in CategoryGrid.php file inside app\/code\/Vendor\/CustomModule\/Block\/Adminhtml\/Rule\/Edit\/Tab\/ directory.<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n * Webkul Software.\n *\n * @category  Webkul\n * @package   Vendor_CustomModule\n * @author    Webkul\n * @copyright Webkul Software Private Limited (https:\/\/webkul.com)\n * @license   https:\/\/store.webkul.com\/license.html\n *\/\n\nnamespace Vendor\\CustomModule\\Block\\Adminhtml\\Rule\\Edit\\Tab;\n\nuse Magento\\Customer\\Controller\\RegistryConstants;\n\n\/**\n * class for the category grid tab in the rule form.\n *\/\nclass CategoryGrid extends \\Magento\\Backend\\Block\\Widget\\Grid\\Extended\n{\n    \/**\n     * @var \\Magento\\Catalog\\Model\\CategoryFactory\n     *\/\n    protected $categoryFactory;\n\n    \/**\n     * @var \\Vendor\\CustomModule\\Model\\ResourceModel\\RuleCategory\\CollectionFactory\n     *\/\n    protected $ruleCategoryCollection;\n\n    \/**\n     * Construct\n     *\n     * @param \\Magento\\Backend\\Block\\Template\\Context $context\n     * @param \\Magento\\Backend\\Helper\\Data $backendHelper\n     * @param \\Magento\\Catalog\\Model\\CategoryFactory $categoryFactory\n     * @param \\Vendor\\CustomModule\\Model\\ResourceModel\\RuleCategory\\CollectionFactory $ruleCategoryCollection\n     * @param array $data\n     *\/\n    public function __construct(\n        \\Magento\\Backend\\Block\\Template\\Context $context,\n        \\Magento\\Backend\\Helper\\Data $backendHelper,\n        \\Magento\\Catalog\\Model\\CategoryFactory $categoryFactory,\n        \\Vendor\\CustomModule\\Model\\ResourceModel\\RuleCategory\\CollectionFactory $ruleCategoryCollection,\n        array $data = &#091;]\n    ) {\n        $this-&gt;categoryFactory        = $categoryFactory;\n        $this-&gt;ruleCategoryCollection = $ruleCategoryCollection;\n        parent::__construct($context, $backendHelper, $data);\n    }\n\n    \/**\n     * @inheritdoc\n     *\/\n    protected function _construct()\n    {\n        parent::_construct();\n        $this-&gt;setId(&#039;loyalty_rule_categorygrid&#039;);\n        $this-&gt;setDefaultSort(&#039;entity_id&#039;, &#039;asc&#039;);\n        $this-&gt;setUseAjax(true);\n    }\n\n    \/**\n     * @param Column $column\n     * @return $this\n     *\/\n    protected function _addColumnFilterToCollection($column)\n    {\n        \/\/ Set custom filter for in category flag\n        if ($column-&gt;getId() == &#039;in_categories&#039;) {\n            $categoryIds = $this-&gt;_getSelectedCategories();\n            if (empty($categoryIds)) {\n                $categoryIds = 0;\n            }\n            if ($column-&gt;getFilter()-&gt;getValue()) {\n                $this-&gt;getCollection()-&gt;addFieldToFilter(&#039;entity_id&#039;, &#091;&#039;in&#039; =&gt; $categoryIds]);\n            } elseif (!empty($categoryIds)) {\n                $this-&gt;getCollection()-&gt;addFieldToFilter(&#039;entity_id&#039;, &#091;&#039;nin&#039; =&gt; $categoryIds]);\n            }\n        } else {\n            parent::_addColumnFilterToCollection($column);\n        }\n        return $this;\n    }\n\n    \/**\n     * Apply various selection filters to prepare the category grid collection.\n     *\n     * @return $this\n     *\/\n    protected function _prepareCollection()\n    {\n        $collection = $this-&gt;categoryFactory-&gt;create()\n            -&gt;getCollection()\n            -&gt;addAttributeToSelect(&#039;*&#039;);\n\n        $collection-&gt;getSelect()\n            -&gt;reset(\\Zend_Db_Select::COLUMNS)\n            -&gt;columns(&#091;&#039;entity_id&#039;]);\n            \n        $collection-&gt;addAttributeToSelect(&#039;*&#039;)\n            -&gt;addFieldToFilter(&#039;name&#039;, &#091;&quot;neq&quot;=&gt;null])\n            -&gt;addFieldToFilter(&#039;is_active&#039;, 1);\n            \n        $this-&gt;setCollection($collection);\n        return parent::_prepareCollection();\n    }\n\n    \/**\n     * @inheritdoc\n     *\/\n    protected function _prepareColumns()\n    {\n        $this-&gt;addColumn(\n            &quot;entity_id&quot;,\n            &#091;\n                &quot;type&quot;     =&gt; &quot;number&quot;,\n                &quot;align&quot;    =&gt; &quot;center&quot;,\n                &quot;width&quot;    =&gt; &quot;30px&quot;,\n                &quot;index&quot;    =&gt; &quot;entity_id&quot;,\n                &quot;header&quot;   =&gt; __(&quot;ID&quot;)\n            ]\n        );\n\n        $this-&gt;addColumn(\n            &quot;name&quot;,\n            &#091;\n                &quot;index&quot;    =&gt; &quot;name&quot;,\n                &quot;align&quot;    =&gt; &quot;left&quot;,\n                &quot;header&quot;   =&gt; __(&quot;Category Name&quot;)\n            ]\n        );\n\n        $this-&gt;addColumn(\n            &quot;in_categories&quot;,\n            &#091;\n                &quot;type&quot;     =&gt; &quot;checkbox&quot;,\n                &quot;name&quot;     =&gt; &quot;in_categories&quot;,\n                &quot;align&quot;    =&gt; &quot;center&quot;,\n                &quot;width&quot;    =&gt; &quot;100px&quot;,\n                &quot;index&quot;    =&gt; &quot;entity_id&quot;,\n                &quot;values&quot;   =&gt; $this-&gt;_getSelectedCategories(),\n                &quot;header&quot;   =&gt; __(&quot;Select&quot;),\n                &quot;sortable&quot; =&gt; false\n            ]\n        );\n\n        $this-&gt;addColumn(\n            &quot;inv&quot;,\n            &#091;\n                &quot;type&quot;     =&gt; &quot;input&quot;,\n                &quot;class&quot;    =&gt; &quot;number_check loyalty_points&quot;,\n                &quot;width&quot;    =&gt; &quot;150px&quot;,\n                &quot;align&quot;    =&gt; &quot;center&quot;,\n                &quot;index&quot;    =&gt; &quot;inv&quot;,\n                &quot;filter&quot;   =&gt; false,\n                &quot;header&quot;   =&gt; __(&quot;Loyalty Points&quot;),\n                &quot;sortable&quot; =&gt; false,\n                &quot;renderer&quot; =&gt; \\Vendor\\CustomModule\\Block\\Adminhtml\\Points::class\n            ]\n        );\n        \n        return parent::_prepareColumns();\n    }\n\n    \/**\n     * @inheritdoc\n     *\/\n    public function getGridUrl()\n    {\n        return $this-&gt;getUrl(&quot;*\/*\/categoryGridData&quot;, &#091;&quot;_current&quot;=&gt;true]);\n    }\n\n    \/**\n     * @return array\n     *\/\n    protected function _getSelectedCategories()\n    {\n        $categoryIds = &#091;];\n        $ruleId      = $this-&gt;getRequest()-&gt;getParam(&quot;id&quot;);\n        $pointsCollection = $this-&gt;ruleCategoryCollection-&gt;create()\n            -&gt;addFieldToFilter(&quot;loyalty_rule_id&quot;, $ruleId);\n        \n        foreach ($pointsCollection as $each) {\n            $categoryIds&#091;] = $each-&gt;getCategoryId();\n        }\n        return $categoryIds;\n    }\n}<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"473\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categoryGrid-1200x473.png\" alt=\"categoryGrid\" class=\"wp-image-305255\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categoryGrid-1200x473.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categoryGrid-300x118.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categoryGrid-250x99.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categoryGrid-768x303.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categoryGrid-1536x605.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categoryGrid.png 1827w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Hope this will be helpful. Thanks \ud83d\ude42<br><br>Next Blog: <a href=\"https:\/\/webkul.com\/blog\/create-category-grid-with-category-children-count-column-in-ui-component-form\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create Category grid with category children count column in UI component form<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to learn how we can create a category grid in the UI component form in the admin section. In Magento 2, when we create a grid in the UI component form, we extend \\Magento\\Backend\\Block\\Widget\\Grid\\Extended Class in our custom grid Class. When you will create a category grid for the <a href=\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":249,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[215,12038,12040,12039,3753],"class_list":["post-305247","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-category","tag-category-grid","tag-category-grid-issue","tag-grid-in-form","tag-ui-component"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Fix category grid issue due to children_count column in custom UI component Form - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Fix category grid issue due to children_count column in custom UI component Form\" \/>\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\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fix category grid issue due to children_count column in custom UI component Form - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Fix category grid issue due to children_count column in custom UI component Form\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\" \/>\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-09-12T17:56:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T14:05:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png\" \/>\n<meta name=\"author\" content=\"Khushboo Sahu\" \/>\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=\"Khushboo Sahu\" \/>\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\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\"},\"author\":{\"name\":\"Khushboo Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\"},\"headline\":\"Fix category grid issue due to children_count column in custom UI component Form\",\"datePublished\":\"2021-09-12T17:56:05+00:00\",\"dateModified\":\"2024-07-24T14:05:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\"},\"wordCount\":337,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png\",\"keywords\":[\"category\",\"category grid\",\"category grid issue\",\"grid in form\",\"Ui Component\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\",\"url\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\",\"name\":\"Fix category grid issue due to children_count column in custom UI component Form - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png\",\"datePublished\":\"2021-09-12T17:56:05+00:00\",\"dateModified\":\"2024-07-24T14:05:37+00:00\",\"description\":\"Fix category grid issue due to children_count column in custom UI component Form\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError.png\",\"width\":1809,\"height\":673,\"caption\":\"categorygridError\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fix category grid issue due to children_count column in custom UI component Form\"}]},{\"@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\/f94b8f53397bf85810761d76c98fadca\",\"name\":\"Khushboo Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Khushboo Sahu\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fix category grid issue due to children_count column in custom UI component Form - Webkul Blog","description":"Fix category grid issue due to children_count column in custom UI component Form","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\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/","og_locale":"en_US","og_type":"article","og_title":"Fix category grid issue due to children_count column in custom UI component Form - Webkul Blog","og_description":"Fix category grid issue due to children_count column in custom UI component Form","og_url":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-09-12T17:56:05+00:00","article_modified_time":"2024-07-24T14:05:37+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png","type":"","width":"","height":""}],"author":"Khushboo Sahu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Khushboo Sahu","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/"},"author":{"name":"Khushboo Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca"},"headline":"Fix category grid issue due to children_count column in custom UI component Form","datePublished":"2021-09-12T17:56:05+00:00","dateModified":"2024-07-24T14:05:37+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/"},"wordCount":337,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png","keywords":["category","category grid","category grid issue","grid in form","Ui Component"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/","url":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/","name":"Fix category grid issue due to children_count column in custom UI component Form - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError-1200x446.png","datePublished":"2021-09-12T17:56:05+00:00","dateModified":"2024-07-24T14:05:37+00:00","description":"Fix category grid issue due to children_count column in custom UI component Form","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/09\/categorygridError.png","width":1809,"height":673,"caption":"categorygridError"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/fix-category-grid-issue-due-to-children_count-column-in-custom-ui-component-form\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Fix category grid issue due to children_count column in custom UI component Form"}]},{"@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\/f94b8f53397bf85810761d76c98fadca","name":"Khushboo Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Khushboo Sahu"},"url":"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305247","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\/249"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=305247"}],"version-history":[{"count":7,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305247\/revisions"}],"predecessor-version":[{"id":454580,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/305247\/revisions\/454580"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=305247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=305247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=305247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}