DataTable Reload blink

DataTable Reload blink

ApocryphoonApocryphoon Posts: 11Questions: 3Answers: 0

Hello again, I would like one last help, good at the moment I have a DataTable that has an auto refresh if the button is 'checked=true' but what happens is the following I have to destroy the DataTable so she doesn't return the error V3, and with that she blinks, what disturbs my users, I would like a help so she doesn't have this "blink", a way to atultimate it without her blinking, thank you in advance :)

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,130Questions: 26Answers: 4,917

    Using ajax.relaod() is one option. Fetching the data via an external ajax request then using clear() followed by rows.add() is another option. Neither of these requires destroying the Datatable nor initializing it. Please post more information of how you are currently reloading the table if you have further questions.

    Kevin

  • ApocryphoonApocryphoon Posts: 11Questions: 3Answers: 0

    Hello Kevin you really are an angel always trying to help me, good then explaining better my situation, I have 1 screen where I used to load the data table the 'table.ajax.url.load()' but I put yesterday 'ajax'.relaod()' happens that to use any of the 2, when I call them on my timeInverval I have to destroy them, if not it returns me the error V3 saying that the table has already been initialized, I believe that this destroy that makes it blink, I'll use my code only with the table so you can help me, right? sorry English, I'm using online translator

    link: (https://jsfiddle.net/Apocryphoon/pn8z97bu/6/)

    obs: Kevin just a remark, I didn't put the whole code because it's too big so I put only the part that encompasses DataBase

    obs: The only exception is that I'm using MVC structure so the 'GetCareOrder' function is receiving the (startDate, endDate, status, OperationFixLoaded, handleGenericError)
    and it's not in the same file as the table, it's in the api connection file, but that's how the code works but I really need the table not to blink, thanks kevin

  • kthorngrenkthorngren Posts: 21,130Questions: 26Answers: 4,917
    Answer ✓

    Is this the function you are having problems with?

            //TIMER STARTA CHAMA A CONEXÃO AJAX DA TABLE
            function reloadTable() {
    
                var reloadTable = $(OperationFixTableId).DataTable({
                    destroy: true,
                    ajax: loadOrdersFix,
    
                });
    
                reloadTable.ajax.reload(null, false);
                TimerPass();
                //valorAutoRefresh();
            }
    

    Have you tried this?

            //TIMER STARTA CHAMA A CONEXÃO AJAX DA TABLE
            function reloadTable() {
    
                var reloadTable = $(OperationFixTableId).DataTable();
    
                reloadTable.ajax.url( loadOrdersFix ).load();
                TimerPass();
                //valorAutoRefresh();
            }
    

    Kevin

  • ApocryphoonApocryphoon Posts: 11Questions: 3Answers: 0

    That would be the refresh function of the table.

    Kevin you saved me man I am with the Dev tool of the browser open and the Table does not blink and has the call of Api, as I am pointing to the test environment I have no data flowing but just by calling the connection I believe it will work, thanks <3

    Problem solved, anything gets in touch, take care. vlw

  • ApocryphoonApocryphoon Posts: 11Questions: 3Answers: 0

    Hello Kevin, have I solved the problem, could you close the topic?

This discussion has been closed.