2

How can I add a button in the Adminhtml Reports>>Sales>>Orders

enter image description here

0

I had to ovveride this file

\vendor\magento\module-backend\view\adminhtml\templates\widget\grid\extended.phtml

and I wanted to be added after line 41 to be added to this class admin__data-grid-export

And it could be done in a way mentioned here

And i edited the code to not be a link but a button:

<button type="button" name="submit" id=click-me  style="margin:0 20px" >Testing</button> 
    <div id="popup-mpdal" style="display:none;">
        <h1> POPUP TEXT </h1>
        <input type="text">
    </div>

    <script>
        require(
            [
                'jquery',
                'Magento_Ui/js/modal/modal'
            ],
            function(
                $,
                modal
            ) {
                var options = {
                    type: 'popup',
                    responsive: true,
                    innerScroll: true,
                    title: 'popup mpdal title',
                    buttons: [{
                        text: $.mage.__('Continue'),
                        class: '',
                        click: function () {
                            this.closeModal();
                        }
                    }]
                };

                var popup = modal(options, $('#popup-mpdal'));
                $("#click-me").on('click',function(){ 
                    $("#popup-mpdal").modal("openModal");
                });

            }
        );
    </script>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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