Open hamburger123456 opened 10 years ago
Hi @hamburger123456,
You can specify that the class assigned to the column header be used.
Relevant section of source
https://github.com/alfajango/jquery-dynatable/blob/master/jquery.dynatable.js#L472
Code Pen
http://codepen.io/drouillard/pen/huonc
Need to do 2 things.
$('#foo_table').dynatable( { table : { copyHeaderClass: true } } );
<th class='className'>Column Header Value</th>
Does this work?
it does. your script has still the same version number. is't it 0.3.1a now.
And another bug: is in line 1481 //.replace(/^[A-Z]/, function($1){return $1.toLowerCase();});
I have to comment it out because its LowerCase the always data-dynatable-column and you can't get the right td (it will be undefined)
Its not camelCase any more ...
@hamburger123456 the script I referenced is the existing 0.3.1 I didn't make any updates to prepare this example. The functionality existed.
In general I do need to do release/bump version, but not for this to work.
@hamburger123456 would you mind filing separate issue for the other issue mention? I don't quite follow and would like to track separately. Thanks.
I tried to add classes by using my own cellWriter. But it doesnt works because I cound't write the cell-contend from outside. So I patched the defaultCellWriter. I added this line before return: td += 'class="dynatable'+column.label.toLowerCase()+'"';
It works well, but can you also show how to add a class-name to cells.