Hidden columns should not get selected when i click on checkbox

Hidden columns should not get selected when i click on checkbox

Goutham.knGoutham.kn Posts: 13Questions: 5Answers: 0

Hi, When i click on checkbox i don't want the values of hidden columns. Hidden column values should not get selected. How to do??
Ex: when a user click on a checkbox the entire row is getting selected irrespective of hidden columns. Hidden column values should not get selected when i click on the checkbox.

unique(onclick)  gross

Account Campaign click cost(hidden) impressions cpm(hidden)
1 Goutham 2 4 10 1 [ ]--> checkbox

2 Gurudhat 4 8 20 2 [check]--> checkbox

when i click on checkbox in the second row cost and cpm should not get selected as those two are hidden because im using cost and cpm in gross.

  unique  gross(onclick)

Account Campaign(hidden) click(hidden) cost impressions(hidden) cpm
1 Goutham 2 4 10 1

2 Gurudhat 4 8 20 2

Many thanks in advance.
https://jsbin.com/gidafejiku/edit?html,js,output

Regards,
Goutham

Replies

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @Goutham.kn ,

    The link doesn't work - there's several errors in the console.

    However, this should do the trick,

    table.cells(rowIdx, function(colIdx, data, node){
        return table.column(colIdx).visible()? true : false;
      }).data().toArray()
    

    Cheers,

    Colin

  • Goutham.knGoutham.kn Posts: 13Questions: 5Answers: 0
    edited November 2018

    Hi Colin,

    Thanks for the response.
    Kindly review the link

    https://jsbin.com/boyoya/edit?html,output

    Regards,
    Goutham

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @Goutham.kn ,

    I got as far as this trying to make it work - there were errors all over the place such as no scripts included and syntax errors. It's still failing as there's a mismatch between the number of columns in the header and that in the body.

    Can you fix it please so that it works and demonstrates what you want looked at.

    Cheers,

    Colin

This discussion has been closed.