I just faced this issue from my custom admin grid tab. That was I forgot to define function "getGridUrl" in my custom tab class.
/**
* get grid url
*
* @return string
*/
public function getGridUrl()
{
return $this->getUrl('*/*/relatedPostsGrid', ['post_id' => $this->getPost()->getId()]);
}
With that, I had to create an admin controller corresponding with "*/*/relatedPostsGrid". This controller extends the one for my custom tab before.
/**
* Save action
*
* @return \Magento\Framework\Controller\ResultInterface
*/
public function execute()
{
$this->initPost(true);
$result = $this->resultLayoutFactory->create();
$result->getLayout()
->getBlock('blog.post.edit.tab.related.posts')
->setPostsRelated($this->getRequest()->getPost('posts_related', null));
return $result;
}
and last thing to do is create a layout handle for this controller, file "*_*_relatedpostsgrid.xml"
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<container name="root" label="Root" output="1">
<block class="Namespace\Module\Block\Adminhtml\Post\Edit\Tab\RelatedPosts" name="blog.post.edit.tab.related.posts"/>
<block class="Magento\Backend\Block\Widget\Grid\Serializer" name="related_posts_grid_serializer">
<arguments>
<argument name="grid_block" xsi:type="string">blog.post.edit.tab.related.posts</argument>
<argument name="callback" xsi:type="string">getSelectedRelatedPosts</argument>
<argument name="input_element_name" xsi:type="string">related_posts</argument>
<argument name="reload_param_name" xsi:type="string">post_related_reload</argument>
</arguments>
</block>
</container>
with block name="blog.post.edit.tab.related.posts"
exactly same the one I defined in my controller.
Missing those code the issue occurs every time I click to refresh the grid filter.
Hope this help.