locked
How can I hide the column 1 and two from the detail line. RRS feed

  • Question

  • User-1355965324 posted

    I  am using a grouped data table using the column  'Office' and 'Position'. So this column again I dont have to show in the details  row. So I want to hide the row  from the details  line.   Please looking for the help with the suggested code. I have given my link.  In my code I want to hide  column 1 and 2 want to hide from the details . The column 0, 3,4,5,6 should be shown in detail. Column 1 and 2 have already being showed in group header line. Any help would be very appreciated

    https://jsfiddle.net/npq6ebog/

    With Many Mny Thanks

    Pol

    Monday, March 25, 2019 10:46 AM

All replies

  • User-1174608757 posted

    Hi polachan,

     According to your code , column 1 and column 2 couldn't be hidden because you have defined below:

        "columnDefs": [
            {"className": "dt-center", "targets": "_all"}
     This will cover the code you set to column 1  and 2 , so I suggest that you could write as below:
       "columnDefs": [
                {
                    "targets": [ 1 ],
                    "visible": false 
                },
                {
                    "targets": [ 2 ],
                    "visible": false
                },
                {
                   "targets":[0,3,4,5,6],
                  "className":"dt-center"
                }
            ],
    
    You could see the result:
    Best Regards
    Wei
    Tuesday, March 26, 2019 2:04 AM