Styles lost on dragged row with RowReorder

Styles lost on dragged row with RowReorder

arnoldchoirsiarnoldchoirsi Posts: 3Questions: 0Answers: 0

Hi,

When i want to move a row (dt-rowReorder-moving class), the styles of all elements inside the row and the styles of the row herself are lost. I tried many things, but i can't explain to me this why. I moved the order of the CSS ans JS files, replaces DataTables files, moved all my JS files in the head tag, back to an older version of jQuery (3.1.1), etc. without any result. The plugin looks works as it should, just any style are unapplied on it during the row is dragged.

I already use an older version (v 1.10.16) of DataTables with RowReorder on another project and everything works great! I love DataTables! ;)

Please help! ;)

Replies

  • arnoldchoirsiarnoldchoirsi Posts: 3Questions: 0Answers: 0

    Finally, problem fixed with shorter rules. Because my English is not perfect, see my example below:

     
    #child-body-container .another-container .like-a-button {
        /* All decorations are lost, during the table row is dragged. */
        /* NB: If I convert my first ID in CLASS, that not solve the problem. */
    }
            
    .like-a-button {
        /* Works! */
    }
     
    

    In all cases, the target table is in my ".another-container" class, so I don't understand why the first rule doesn't work. I tried another plugin to do the same job and everything was OK.

    If you have an explanation... Thx!

  • arnoldchoirsiarnoldchoirsi Posts: 3Questions: 0Answers: 0
    edited June 2020

    CSS rules can start from tables and to fix a font size problem, doesn't use EM, but use pixels or REM instead.

    table.dataTable {
        /* works! */
    }
    
    table.dataTable .what-you-want {
        /* works */
    }
    
    table.with-a-class-or-not td {
        font-size: 0.8em; /* doesn't work */
        font-size: 0.8rem; /* work! */
        font-size: 12px; /* work! */
    }
    

    Thank so much myself...

This discussion has been closed.