collection option backgroundClassName can only handle 1 class

collection option backgroundClassName can only handle 1 class

frigglefriggle Posts: 11Questions: 1Answers: 0

collection has the option backgroundClassName.

I was attempting to use this property the same way as other classNames, where multiple classes can be supplied using space separation.

If more than one class is supplied, the background will be successfully created when the collection is invoked, but it will not be removed when the collection is dismissed.

http://live.datatables.net/sirafidi/1/edit?css,js,output

I know the documentation does not say that it supports more than one class, but this is still problematic behavior. Every other 'className' option supports multiple classes, so this is a notable inconsistency.

Specifically, I am using the Bootstrap styling. In the Bootstrap styling, the default class dt-button-background has no color. I would like to use the same background as the Bootstrap modals, which uses two classes (.modal-backdrop.in).

I can work around this by creating my own class, obviously, but I think backgroundClassName should be capable of handling > 1 class.

Replies

  • allanallan Posts: 58,914Questions: 1Answers: 9,485 Site admin

    I completely agree. Thanks for suggesting this!

    I'll make the required change later this week and will post back when it is committed.

    Regards,
    Allan

  • frigglefriggle Posts: 11Questions: 1Answers: 0

    Allan, you're the best author a dev could hope for

  • allanallan Posts: 58,914Questions: 1Answers: 9,485 Site admin

    Committed and it will be in the next release (1.2.2). The nightly will rebuild in the next few minutes with the fix.

    Thanks for letting me know about this!

    Regards,
    Allan

This discussion has been closed.