Skip to content

Export Button in sales orde grid Magento 2

I am adding below code in sales_order_grid.xml but it shows form key error. i want to export in txt file. How can i achieve this. please suggest. need to add formkey or url issue ?

<exportButton>
            <settings>
                <options>
                    <option name="txt" xsi:type="array">
                        <item name="value" xsi:type="string">txt</item>
                        <item name="label" xsi:type="string" translate="true">TXT</item>
                        <item name="url" xsi:type="string">Vendor_Module/index/index</item>
                    </option>
                </options>
            </settings>
        </exportButton>