How can I use a variable for a class in rowGroup.endClass ?

How can I use a variable for a class in rowGroup.endClass ?

MelodyNelsonMelodyNelson Posts: 132Questions: 21Answers: 2

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

Hi,

I'm using a page with a datatable on multiple « interfaces » of the same website, each site has some specifications in their CSS file.

The basic example is a text color definition for each site, something like :
- txt-color-siteA
- txt-color-siteB
- etc

When I'm using rowGroup, I want to use this class.

I have a JS variable called « interface », the content will be siteA, siteB, siteC, etc depending on the page i'm on.

When I'm in the JS code of datatable, how can I use my variable interface ?

    rowGroup: {
        dataSrc: 'dateDebut.annee',
        startClassName: 'rupture',
        endClassName: 'soustotal txt-color-' + interface
    },

Thank you

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,800Questions: 26Answers: 4,862
    edited October 2023 Answer ✓

    Make sure the interface variable is available in the local or global scope of the Datatables code. For example:
    https://live.datatables.net/pimowicu/1/edit

    Kevin

  • MelodyNelsonMelodyNelson Posts: 132Questions: 21Answers: 2

    Thank you Kevin

    I've tried but it didn't work because of the application I'm using, for a reason I don't understand the content of my variable is lost. I will ask to the developers for help.

Sign In or Register to comment.