confirm on close example not working with jqueryui

confirm on close example not working with jqueryui

loukinglouking Posts: 259Questions: 52Answers: 0
edited August 2020 in Editor

Test case without jqueryui: http://live.datatables.net/widoxiyu/1/edit
Test case with jqueryui: http://live.datatables.net/fezipuji/1

I copied the code from https://editor.datatables.net/examples/api/confirmClose. I'm seeing the error in a child row editor, but not sure that is relevant.

Note I couldn't get the styling working maybe because editor.jqueryui.min.css failed to load, but that is irrelevant.

If I edit a child row, change a field, then try to close the edit modal I see the confirmation message. If I cancel the confirmation message, the edit modal disappears even though I cancelled.

This seems to be related to jqueryui.

This question has an accepted answers - jump to answer

Answers

  • loukinglouking Posts: 259Questions: 52Answers: 0

    Hi, just bumping this -- maybe it got lost over the weekend.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I've updated the styling: http://live.datatables.net/jafenuni/1/edit . The download builder will help with that sort of thing.

    If I edit a child row, change a field, then try to close the edit modal I see the confirmation message.

    I'm not getting that. Maybe I broke it when fixing the styling? Unfortunately I'm short of time this evening to debug it further at the moment I'm afraid.

    Allan

  • loukinglouking Posts: 259Questions: 52Answers: 0
    edited August 2020

    http://live.datatables.net/jafenuni/1 does indeed do the behavior I mentioned.

    Follow these steps

    • Bring up http://live.datatables.net/jafenuni/1
    • Click live preview (all operations below are in live preview window)
    • Expand a row
    • Select a row in the child table
    • Click edit to edit the selected row in the child table
    • Type anything in the form
    • Click X to close the form
    • On the confirmation alert, click cancel
    • Both the confirmation alert, and the form disappear
    • (the form should remain)

    Perhaps a clue? If you do this more than once, the confirmation message is redisplayed the number of times you do this. But maybe that's a red herring. Actually that's probably happening because the 'postCreate postEdit close' handler isn't executing. Which may or may not be a clue.

    Seems like jqueryui is getting in before Editor has a chance to handle the confirmation.

  • loukinglouking Posts: 259Questions: 52Answers: 0

    I was also able to reproduce the problem in a simpler test case without a child row: http://live.datatables.net/qizenidu/1

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Please can you provide steps on how to reproduce on that last example,

    Colin

  • loukinglouking Posts: 259Questions: 52Answers: 0

    I had to clone it in order to see live preview. Not sure why this happens with my bins but they time out.

    http://live.datatables.net/tocixequ/1

    • live preview
    • select row
    • Edit
    • type something in form
    • X to close form
    • confirmation alert displayed
    • cancel confirmation alert
    • form disappears (should remain on page for continued editing)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Thanks for the clarification. It is an error in our jQuery UI integration for Editor. We let jQuery UI handle the close button, but actually we need to override that.

    I've put the updated jQuery UI integration code into your example here: http://live.datatables.net/mugoyagi/1/edit . It will also be in the next Editor release (1.9.5).

    Regards,
    Allan

  • loukinglouking Posts: 259Questions: 52Answers: 0

    perfect, thanks

This discussion has been closed.