Topic: Change selector in datatables / Table Editor

henrik pro asked 5 years ago


How do I change the selector in dataTables so that only clicking on for instance the last coloumn will initiate Selct of that row.

I have tried using 

$('#example').DataTable( {
    select: {
        selector: 'td:last-child',
    }
} );
$('#guide-trin-oversigt').mdbEditor();

And other selectors, but it always remain possible to click on all columns.


henrik pro commented 5 years ago

By adding dataTables extension Selext i can achieve what i want (only select tables by clicking last column). 

Unfortunately initialising .mdbEditor() will break that behaviour and make the entire row area for selection again.

I cannot find any documentation on mdbEditor (TAble Editor) on how to change that behaviour. 

 


Anna Morawska staff answered 5 years ago


Hi there,

i'm not sure what you want to achieve. Could you paste in here your code snippet

Best,

Ania


henrik pro commented 5 years ago

https://mdbootstrap.com/snippets/jquery/henrik/282116

Snippet added in post


henrik pro commented 5 years ago

The select style of the table is always set to 'single' and the entire row is selectable.

https://datatables.net/reference/option/select.selector

Does the MDB package include the selector extension or does it need to be added manually?

 


Piotr Glejzer staff commented 5 years ago

Our package doesn't include selector extensions so if you would like to have that option you need to add this manually. But for next release, that extension will be available in our package. 



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: Yes
  • Provided link: Yes