Skip to content

Hide Column button no longer working #334

Closed Answered by cortexrd
Deanobeano2 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you're right. Some code has changed around this ktlDisplayNone class.

Here's the new code that should work:

const MY_TOGGLE_COLUMNS_VISIBILITY_GRID = 'view_695';
$(document).on('knack-view-render.' + MY_TOGGLE_COLUMNS_VISIBILITY_GRID, function (event, view, data) {
    const gridViewButtonsDiv = document.createElement('div');
    gridViewButtonsDiv.setAttribute('id', 'gridViewBtnDiv');
    gridViewButtonsDiv.style.marginTop = '10px';
    gridViewButtonsDiv.style.marginBottom = '30px';

    const div = document.querySelector('#' + view.key);
    if (div) {
        div.prepend(gridViewButtonsDiv);
        var visible = false;
        var toggleColumnVisibilityBtn = ktl.fields.addButton…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Deanobeano2
Comment options

You must be logged in to vote
1 reply
@cortexrd
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants