I have a working Grid Serializer. Now I want to clear the Grid Serializer values without refreshing page. So, I added a jquery script to clear the hidden field:

$("input[name='links[products]']").prop("value", "");

It works fine when I am on the first page, but when I go to the next page and clear the hidden Grid Serializer it will not clear for the previous page.

I can able to see that the Grid Serializer hidden field was empty, but when I tried to do a search or reset filter the hidden values are posted in the form data.

I don't know how the post values are posted even the hidden field was empty. Is there any way to clear the Grid Serializer values?

1 Answer 1

            <block class="Magento\Backend\Block\Widget\Grid\Serializer\Serializer" name="grid_serializer">
                    <argument name="input_names" xsi:type="array">
                        <item name="0" xsi:type="string">products</item>
                        <item name="1" xsi:type="string">base_price[]</item>
                        <item name="2" xsi:type="string">final_price[]</item>
                    <argument name="grid_block" xsi:type="string">customer.product.listing</argument>
                    <argument name="callback" xsi:type="string">getSelected</argument>
                    <argument name="input_element_name" xsi:type="string">links[products]</argument>
                    <argument name="reload_param_name" xsi:type="string">products</argument>
  • Finally It worked.
    – Gen Impact
    Jan 1, 2019 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.