Thursday, March 19, 2020

Show/Hide Column in Views Table in drupal 7 and drupal 8

  // Hide the Name Column when Nick Name is shown
$('#edit-dyfield-field-girls-nickname').change(function() {
    if ($('#edit-dyfield-field-girls-nickname').is(':checked')) {
        $(document).ajaxStop(function() { // Forcefully stopping Ajax function in the page as other ajax load was main culprit in my case
            $('.views-field-title').hide();
        });
    }

    if ($('#edit-dyfield-field-girls-nickname').is(':not(:checked)')) {
        $(document).ajaxStop(function() {
            $('.views-field-title').show();
        });
    }
});

No comments:

Post a Comment

If you have any problem please let me know.