Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to wary rendered column data according to condition? #140

Open
lehtone1 opened this issue Oct 13, 2021 · 1 comment
Open

How to wary rendered column data according to condition? #140

lehtone1 opened this issue Oct 13, 2021 · 1 comment

Comments

@lehtone1
Copy link

lehtone1 commented Oct 13, 2021

I noticed that it is possible to do custom rendering for column with ColumnDT("<a href=''>" + User.id + "</a>"). How can I differ how the data is rendered according to a conditional? I would like to do something like this:

ColumnDT(
    if(User.id == 1):
        "<a href=''>" +  User.id + "</a>"
    else:
        User.id
)
@lehtone1
Copy link
Author

Ok got it. Apparently you need to just do it with columnDefs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant