angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

Question v0.4.3: how to change class name of selected row ?

Open nemcuon opened this issue 10 years ago • 1 comments

Hi all,

I could choose to enable the Select Extension https://datatables.net/extensions/select/ by using

.withOption('select', true)

Now, when I want to also change the class name of the selected item (by default it is 'selected'), after reading https://datatables.net/reference/option/select.className I have tried

.withOption('select', {className : 'myOwnClassName'})

It does not work, I inspected the element, and see that the class name of the selected item is not 'myOwnClassName' nor 'selected'.

Any idea why?

nemcuon avatar Jun 08 '16 10:06 nemcuon

I found the answer

Possible reason why the documentations on both websites (jQuery based Datatables va Angular-Datatables) don't work for my Select Plugin/Extension:

I use

  • v.0.4.3 of Angular-DataTables (a bit old)
  • latest documentation of Angular-DataTables: which is wrong: i don't see anywhere in the code (even the latest v.0.5.5) the support for the following documentation http://l-lin.github.io/angular-datatables/#/withSelect
  • latest version of Select Extension and latest version of jQuery DataTables

So my own solution is to use some undocumented feature of both (Angular and jQuery DataTables). Infact

a) the following statements work

.withOption('select', {style: 'os', className : 'myOwnClassName'}) .withOption('select', true)

b) the following statements don't work .withOption('select', {'myOwnClassName'})

nemcuon avatar Jun 09 '16 08:06 nemcuon