Add new row

Add new row

andras2andras2 Posts: 31Questions: 12Answers: 0

I am aiming to build Electron like Eel application with Python and for DataTable I tried to use the simple HTML datasource when the source is embedded in the html code as table rows. I had the example sample code with data and I tried to replace the html code with innerHTML by replacing the content.
The data loaded successfully, however the pagination and other functions are not working and pagination reads the same amount of data as it was in the initial HTML code.

Is there any function to load the data after code changing with innerHTML?

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Sounds like you might be initializing Datatbles then updating the HTML table directly. If so please see this FAQ. If this doesn't help then please provide more details of exactly what you are doing. Maybe post the relevant Javascript code. Take a look at the Data docs for details of how to apply the table data to Datatables.

    Kevin

  • andras2andras2 Posts: 31Questions: 12Answers: 0

    This is exactly what happened.

    • I tried modifyind the DOM but I have to use DataTable API to add row.
    • I tried Ajax txt file, but it seems it does not refresh automatically.

    Can you suggest a method, how to read data dynamicly? I can produce data files that Ajax would read continously. Do I need extra code for that?

  • andras2andras2 Posts: 31Questions: 12Answers: 0

    In the meantime I found the refresh; ajax.reload method that works.

    https://datatables.net/reference/api/ajax.reload()

    Thanks,

Sign In or Register to comment.