I would like to select a row just with the checkbox, and not clicking on other cells

I would like to select a row just with the checkbox, and not clicking on other cells

gbraultgbrault Posts: 9Questions: 3Answers: 0

I use the select extension and ad a select checkbox in the begining of a row:

table_options = {
"select": {"style": "single"},
...
"columns": [
{ "title": ..., "data": ... },
...
]
...
}

then my code add the checkbox:
table_options.columns.unshift({data: null, orderable: false, searchable: false, render: DataTable.render.select()});

this works great!

However, in some use cases, I have interactive fields in some cells and the fact selection occurs whatever cell of a row is clicked is not good UX!

Is there a way to avoid selection of a column, in the column option definition or any other way?

Thanks

Answers

  • allanallan Posts: 63,700Questions: 1Answers: 10,501 Site admin

    Normally I would suggest limiting the row selection to just the checkbox column. See this example.

    Allan

  • gbraultgbrault Posts: 9Questions: 3Answers: 0

    Many thanks @allan works great!

Sign In or Register to comment.