Sort and click events don't fire in popup

Posted by: ed on 18 July 2019, 4:28 am EST

    • Post Options:
    • Link

    Posted 18 July 2019, 4:28 am EST

    I have added a popup of a flexgrid. I can get the popup to display correctly but when I click on a column heading to sort, the sort event doesn’t fire. Also, have an event listener for the click event which also doesn’t fire. I have attached a document with my HTML and Javascript code.

    If I comment out the “$(‘#popupGrid’).toggle();” line of code so that the grid displays on the page those events fire.

    My application if an MVC Core 2.2 application and I am running build 5.201913.615 of Wijmo.

    I appreciate your help.

    Thanks, Ed

    code for popup.zip

  • Posted 18 July 2019, 8:15 pm EST

    Hi Ed,

    The reason that the observed issue is arising because you are setting the content of Popup by cloning the node of the FlexGrid. The cloneNode method only copies the HTML of the provided node. So, all the events that were registered using addEventListener will not be copied to the cloned node and therefore sorting, etc will not work in the popup.

    To solve the issue, you may move the grid inside the popup. Refer to the code snippet below:

    <div id="thePopUp">
        <div class="d-flex justify-content-center align-items-center container">
            <div class="row">
                <div id="popupGrid" class="grid"></div>
            </div>
        </div>
    </div>
    

    You may also refer to the sample below:

    https://stackblitz.com/edit/js-soxgkr

    Regards,

    Ashwin

  • Posted 12 April 2021, 12:02 am EST

    HI,

    I have one requirement where we have to show a popup on click sorting icon with “Are you sure to apply sorting” with ok button and after click ok sorting will be performed.

    Is there any event or way to full fill this requirement.

    I am looking this.

    Deepak Dubey

  • Posted 12 April 2021, 5:17 pm EST

    Hi Deepak,

    You can handle the sortingColumn event of the FlexGrid. In the handler, cancel this event and display the popup. If the yes button is clicked, then sort the column manually:

    https://stackblitz.com/edit/js-lzxz48

    Regards,

    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels