Bug with Buttons colVis

Bug with Buttons colVis

lazzylazzy Posts: 21Questions: 8Answers: 0

Hello,
i have bug with multi filter - type select in header.
column visibility with show lable title and all options in select

exemple my column
<th class="sorting_disabled" rowspan="1" colspan="1" aria-label=" Agence - any -ParisLyon">
<label for="search-field-agence-chantier">Agence</label>
<select id="field-agence-chantier" name="field_agence_chantier" class="form-control search form-select">
<option value="">- any -</option><option value="Paris">Paris</option><option value="Lyon">Lyon</option></select> </th>
it will show Agence - any -ParisLyon. how can i got only label Agence?

This question has accepted answers - jump to:

Answers

  • lazzylazzy Posts: 21Questions: 8Answers: 0

    i think file buttons.colVis.js
    line 151
    should add
    var title = dt.settings()[0].aoColumns[ idx ].sTitle
    .replace(/<select(.*)<\/select>/g, "")

  • allanallan Posts: 63,160Questions: 1Answers: 10,406 Site admin
    Answer ✓

    Yup - its a little hacky, but that's a good wrong around for now until I sort out a better API for this sort of thing.

    Fix committed here and it will be in the next release.

    Regards,
    Allan

  • lazzylazzy Posts: 21Questions: 8Answers: 0

    Hello,
    I have one question. How can change colVis like checkboxes? checkboxes makes user able understand column visibility more quickly than an button color.
    for bootstrap theme how can i change it to list group ?https://getbootstrap.com/docs/3.3/components/#list-group

  • kthorngrenkthorngren Posts: 21,141Questions: 26Answers: 4,918

    You might be able to adapt this example to use checkboxes:
    https://datatables.net/examples/api/show_hide.html

    Kevin

  • lazzylazzy Posts: 21Questions: 8Answers: 0

    yes it is another way but colVis is best way. can i make custom button ?
    it look like buttons: [
    'copy', 'colVisCheckboxes', 'pdf'
    ]
    and i create file buttons.colVisCheckboxes.js in same folder?

  • allanallan Posts: 63,160Questions: 1Answers: 10,406 Site admin
    Answer ✓

    At the moment, the best option is probably to use a UTF8 checkbox character and put that in to the CSS for your page.

    div.dt-button-collection a.dt-button span:before {
      display: inline-block;
      content: '\2610';
      padding-right: 6px;
    }
    
    div.dt-button-collection a.dt-button.active span:before {
      display: inline-block;
      content: '\2611';
      padding-right: 6px;
    }
    

    http://live.datatables.net/xuxejava/1/edit

    Allan

  • lazzylazzy Posts: 21Questions: 8Answers: 0

    oh thanks dont think about it with ccss and symbol

This discussion has been closed.