Undocumented feature-option columns.class
Undocumented feature-option columns.class
there is the columns.className option, which determines the class of a column's cells..
However, there is ALSO (apparently) an undocumented "feaure" in the form of an option, called columns.class (without the Name part). The difference between the two is that .class applies the classes specified to the column's header cells as well, and not only the data.
This is very handy, when for example you want to apply a class like text-right, to a column, but instead of both having to define it in the html of the thead, as well as in the columns definition for that specific column, you just define it in the columns definition.
Allan.. is that indeed a feature? or a glitch??
Replies
columns.className
will apply to the header as well - see this example.The fact that
columns.class
works is an artifact of the backwards compatibility for the old Hungarian notation parameter style, where that parameter was calledsClass
. The camelCase version of that is simplyclass
butclass
is a reserved word in Javascript. It can be used in objects, but there are edge cases where it could cause issues, hence why I recommend usingcolumns.className
. They should be identical.Allan