On page form display

On page form display

nklinkersnklinkers Posts: 11Questions: 2Answers: 0

Hello,
I like this blogpost: https://datatables.net/blog/2017-06-30 and want to use it in my own website.
I want to use it in a modal when I click on an edit button on my screen. So I get a bootstrapmodal where I want to place this form. I almost got it running but it doesn't show any records and when I click Add new record my modal closes.
I made the example in a different standalone html page and it works as described in the blog, but when I copy it to my body of the modal it doesn't work anymore.
What can be wrong?

Replies

  • allanallan Posts: 43,187Questions: 1Answers: 5,628 Site admin

    Hi,

    I don't quite understand the link between the blog post and a modal. The point of the blog post was to have no modal - the form would be shown without one. Or do you mean you want a table and and editing panel inside a modal?

    Could you link to your page so I can see what you've got?

    Thanks,
    Allan

  • nklinkersnklinkers Posts: 11Questions: 2Answers: 0

    Hello Allan,

    website is on local net only. Yes I have a list with items and an edit button behind them and when clicked on one, it should open a modal where this example as mentioned in the blog post should work. I have this already, but no data is shown and when I click on Add new the modal closes and goes back to my 1st form.

    Thank you.
    Noël

  • allanallan Posts: 43,187Questions: 1Answers: 5,628 Site admin

    I still don't really get it I'm afraid. The point of the blog post is that there is no model when clicked on.

    Can you publish the page you are working on to the web please? I'd need to be able to see it to understand what is happening.

    Thanks,
    Allan

  • nklinkersnklinkers Posts: 11Questions: 2Answers: 0

    Hello Allan,

    I made the page public: http://31.149.45.110:9090/qmanager_v3/settings_touchscreen.php
    When you click on a button "Bewerk" it gives the modal where you should be able to add/delete/edit the time that the desired button where you clicked "Bewerk" should be visible. No data is shown and when you click Add in the modal, the modal closes.
    Can you let me know when you had a look at it, so I can get the page offline again.
    Thanks in advance.

  • nklinkersnklinkers Posts: 11Questions: 2Answers: 0

    @Allen:
    on this page it works: http://31.149.45.110:9090/qmanager_v3/settings_ts_visible.html
    I copied everything and tried to make it work in the modal...

  • allanallan Posts: 43,187Questions: 1Answers: 5,628 Site admin

    There is a Javascript error happening on the page:

    Uncaught TypeError: Cannot read property 'Editor' of undefined
    at HTMLDocument.<anonymous> (table.settings_ts_visible.js:41)

    It looks like DataTables hasn't been included on that page.

    Regards,
    Allan

  • nklinkersnklinkers Posts: 11Questions: 2Answers: 0
    edited November 16

    Hello Allan,

    It is included on the page. I included dataTables.editor.min.js in the header page I include on every page. Where do you see this error? When I use the F12 functions in the browser it shows that dataTables is included.

    <link rel="stylesheet" href="Classes/Editor-PHP-1.6.5/css/dataTables.editor.css">
    <link rel="stylesheet" href="Classes/Editor-PHP-1.6.5/css/editor.bootstrap4.min.css">
    <script src="Classes/Editor-PHP-1.6.5/js/dataTables.editor.min.js"></script>
    <script src="Classes/Editor-PHP-1.6.5/js/editor.bootstrap4.min.js"></script>
    <script src="bootstrap/js/jquery-3.1.1.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    

    I hope you can explain to me.
    Thanx.

  • nklinkersnklinkers Posts: 11Questions: 2Answers: 0

    Thank you Allan,

    I fixed it.
    It was the ordering of loading the scripts....

    Many thanks for pointing me in the right direction.

    Regards,
    Noël

Sign In or Register to comment.