Import CSV with Bootstrap 4 Not Loading Second Modal

Import CSV with Bootstrap 4 Not Loading Second Modal

ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2

Having the same issue as what is detailed on this this thread.

Can't get the examples to load properly for some reason, but the issue is identical. It was noted as fixed in Editor 1.9.1, but I am currently on 2.0.2 and the issue is coming back up. I'm wondering if this is a regression issue.

If I use the standard DataTables styling, the issue goes away. If I attempt to use the Bootstrap 4 styling, the second modal for selecting columns never appears.

This question has accepted answers - jump to:

Answers

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2
    edited May 2021

    Got an example to work. PapaParse is included, and after doing a file upload the modal just goes away.

    After that no additional modals can pop up at all.

    Example: http://live.datatables.net/tihuvoha/1/edit

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    edited May 2021 Answer ✓

    Hi,

    Thanks for alerting us to this! The most straightforward fix is a small modification in the code that handles the upload action - specifically, remove the close() call.

    In our example that is uploadEditor.close(); - removing that will let it work as expected.

    I've committed that into our import example and it will be deployed with the next release.

    Regards,
    Allan

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2
    edited May 2021

    EDIT: Actually spoke too soon. It appears that fixes it for the just after uploading the file, but now it simply does it right after confirming the columns. Now after confirming the columns the same thing happens. There is no point where .close() method is called again in the code, so I think it must be happening at the point when editor.create() is called?

    Updated Example with .close() removed: http://live.datatables.net/tihuvoha/6/edit?html,js,output

  • allanallan Posts: 61,635Questions: 1Answers: 10,092 Site admin
    Answer ✓

    You are absolutely right - sorry about that! One more change required. In the selectEditor.create config object we need to also pass in onComplete: 'none'. This will ensure that when you click the button to confirm the selection of the columns it won't try to remove the modal display (our own modal works since we can cancel that - but there is no option to cancel a Bootstrap modal close - thus this workaround is needed).

    Updated example: http://live.datatables.net/tihuvoha/7/edit

    Allan

  • ITAppData@HomeStreet.comITAppData@HomeStreet.com Posts: 54Questions: 13Answers: 2

    That did it. Thanks again for all the assistance :smile:

Sign In or Register to comment.