Is there a way to deactivate the parent background div when a child container div is in use?

Is there a way to deactivate the main background container that holds a grid with data? Within this grid, users have options for sorting and exporting the data into formats like csv/pdf. Additionally, there is a filter button on the grid that, when clicked (via ng-click= xyz();), opens a filter overlay. This overlay is a child container div inside the parent div. The goal is to disable the functionality of the parent grid when the filter overlay div is active, preventing sorting, exporting, and any other actions on the parent div.

I would appreciate any assistance or guidance on how to achieve this. My entire project is built in angular js. A demonstration or example with code snippets would be highly beneficial!

In agg.service.js

angular.module('ccar14a.common').factory('ccar14a.common.AggService', [
'ccar14a.common.Config',
'StatusService',
'ccar14a.common.TcnService',
'ccar14a.common.PivotService',
'ccar14a.common.GridConfigService',
'$timeout',
function(Config, StatusService, TcnService, PivotService, GridConfigService, $timeout) {

    var service = { 
            openFilterOverlay: function() {
            console.log("Toggle Filter overlay00");

           var filteroverlay = angular.element(".filter-overlay");

           if(filteroverlay.hasClass('open')) {

               filteroverlay.removeClass('open');
           } else {
               filteroverlay.addClass('open');
           }
            angular.element('.tooltip').hide();
        },
   };

    return service;
   }]);

In index.html

<div class="col-md-12 main-view" ng-controller="ccar14a.common.drillDownController">

<div class="ddt-container">
    <h2>
    <span>
        {{config.title}} v{{config.version}}.
        <a href="" ng-click="getInitialFilter(true)"
                    ng-disabled="aggService.gridDisconnected" ng-if="config.initialTitle">
            {{config.initialTitle}}</a>
        <!--<span class="pull-right" style="font-size: 10px">, RDA: {{config.rda}}</span>-->
        <!--<span class="pull-right" style="font-size: 10px">Bridge: {{config.bridge | bridgeDomain}}</span>-->
    </span>
    <div class="ddt-links pull-right">
        <a href="" ng-click="about()">
            About</a>
        <a href="" ng-click="help()">
            Help</a>
    </div>
</h2>
</div>

<!--div container for filter overlay starts here-->

<div class="container-fluid ddt-container" ng-controller="ccar14a.common.drillDownController" id="ccar14a">
    <h2 ng-hide="true" class="remove">
    <span>
        {{config.title}} v{{config.version}}.
        <a href="" ng-click="getInitialFilter(true)"
                    ng-disabled="aggService.gridDisconnected" ng-if="config.initialTitle">
            {{config.initialTitle}}</a>
        <!--<span class="pull-right" style="font-size: 10px">, RDA: {{config.rda}}</span>-->
        <!--<span class="pull-right" style="font-size: 10px">Bridge: {{config.bridge | bridgeDomain}}</span>-->
    </span>
    <div class="ddt-links pull-right">
        <a href="" ng-click="about()">
            About</a>
        <a href="" ng-click="help()">
            Help</a>
    </div>
</h2>


    <div class="ddt-sidebar filter-overlay col-md-2">

        <div class="row">
            <div class="col-md-6">
                <div class="form-group ddt-filter-box-group">
                    <select class="form-control ddt-filter-box-fld" ng-model="savedFilter" ng-change="aggService.submitScenario(filter)">
                        <option value="">My Saved Filters</option>
                    </select>
                </div>
            </div>

            <div class="col-md-6">
                <button type="button" class="filter-close close-filter pull-right" ng-click="aggService.openFilterOverlay()"><i class="glyphicon glyphicon-remove filter-close"></i></button>

            </div>
        </div>

        <!--The code continues having several filter box  -->
 <div class="ddt-content col-xs-12" ng-class="{'col-md-10': !showControlPanel, 'col-xs-12' : !showControlPanel}">
            <div class="ddt-grid" ng-controller="ccar14a.common.AggController" ng-show="config.displaySummaryGrid">
                <ng-include src="'templates/summaryGrid.html' | embedUrl"></ng-include>
</div>

In summaryGrid.html

<div class="grid-header">

<button type="button" class="btn btn-sm ddt-btn-medium pull-left" ng-show="true" ng-click="aggService.openFilterOverlay();">
    <i class="glyphicon glyphicon-filter" tooltip="Open Filter" tooltip-placement="right"></i>
</button>
<!-- Code for other functionalities continues-->
</div>

In styles.css

.filter-overlay {
position: absolute;
left: -500px;
background: #EEE;
transition: 1s;
z-index: 1000;
box-shadow: 5px 5px 10px 3px #aaaaaa;
height: 100%;
min-width:365px;
overflow-y: auto;
 }

.filter-overlay.open {
transition: 1s;
left: 0;
}

.filter-overlay .row {
margin-left: 0;
margin-right: 0;
margin-top: 8px;
margin-botton: 12px;}

.container-fluid {
background-color: #F0F3F6;
height: 100%;
padding: 18px;}

.container-fluid .row{
margin-left: 0;
margin-right: 0;}

.ddt-content {
padding-left: 0;
padding-right: 0;
background-color: white;}

.tab-content > .tab-pane {
display: none;}

.tab-content > .active {
display: block;}

Answer №1

By deactivating the main element, it will naturally deactivate the associated child elements as well. Rather than structuring them as parent and child, consider organizing those two divs as siblings and controlling their visibility individually based on the main element's visibility.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing $compile within a Directive to manipulate a dynamic attribute value

I am working on a simple Directive that involves a submit button. The goal is to display a loading icon when the button has been submitted, with the specific type of loading icon determined by an attribute. However, I encountered an issue where $compile s ...

Conceal overflow in SVG after stroke is applied to top rectangle border

Is there a way to conceal the overflowing red color in this SVG? I attempted repositioning it before the rect with the stroke, but that didn't solve the issue. Check out the code and screenshot below. <br><br> <svg _ngcontent-fdl-c1 ...

The functionality of jQuery's slideUp and slideDown is not performing as intended

I am trying to implement a feature where a div element will hide and show based on a checkbox selection using jQuery's slideUp() and slideDown() functions. The structure of my div is as follows: <div class="parent"> <label class="childLe ...

Display a confirmation dialog using AngularConfirm after a function in AngularJS has finished executing

Trying to figure out how to update the $ngConfirm box after a function is done. When submit is clicked, a spinning cog appears: https://i.sstatic.net/lxwrH.png $scope.inProgress = function(){ $ngConfirm({ theme: 'modern', i ...

Trouble displaying image due to issues with javascript, html, Angular, and the IMDb API integration

I have been working on displaying images from the IMDb API in my project. Everything works perfectly fine when I test it locally, but once I deploy the project to a server, the images do not load initially. Strangely, if I open the same image in a new tab ...

Display all active services in a new list item using AngularJS Ionic's ng-repeat directive

I've been working on a shopping cart feature for my Ionic app and everything is coming together nicely, except for the running itemized total. By default, the items in my array are set to active:false and when selected, they switch to active:true and ...

After refreshing the page in Next JS, there is a delay in loading the Swiper Js styles. The Swiper slides appear stretched while waiting for Next JS to load the styles. Any suggestions

Having an issue with my Next 14.0.3 app and tailwind CSS. I recently installed swiper JS version 11.0.5 using npm. The problem arises when I reload the page, it takes about 1 or 2 seconds for the swiper styles to load. During this time, the swiper slides s ...

Retrieve the HTML structure from an AJAX response

I'm working on an Ajax call in my code: callAjaxController: function(){ var url = Routing.generate('ajax_price'); $.ajax({ type: "GET", url: url, cache: false, success: funct ...

Display a division when an option is selected within a looped dataset

i am working with some PHP code: <?php $produk = mysql_query("SELECT * FROM produk ORDER BY id_produk DESC"); while($p=mysql_fetch_array($produk)){ <select name='urutan' onChange='yesnoCheck(this);'> <option va ...

Tips on updating CSS styles for navigation bar links in real time

Currently, my homepage displays a CSS content hover effect when the user interacts with the icons. However, I am facing an issue where all icons show the same text "home" on hover. How can I customize the text output for each individual icon/link? Your hel ...

Locate a row in an unselected data table using Jquery based on the value in a td

Is there an efficient way with jQuery to locate a td in a "legacy" datatable that contains my search value, and then navigate up the row tr? I am currently using $('#modalTable tbody').dataTable()[0].rows to retrieve all rows and then iterate th ...

Guide on converting this function into a computed property within Vue

Is it possible to concatenate a fixed directory path, which is defined in the data property, with a file name that is determined using v-for? I encountered an issue when attempting to do this using a computed property. The error message displayed was: ...

What is the best way to retrieve the text input fields while using express-fileupload with React?

Front end Uploading a File: <div className="form-group row"> <label htmlFor="directorySSH" className="col-sm-3 col-form-label">Directory: </label> <div className="col-sm-7"> <input ty ...

After I designed a single modal for all buttons, I encountered an infinite loop error

I'm facing an issue with my buttons and modal functionality. I have three buttons with different content, each linked to a modal that should display the corresponding data upon click. However, after reloading the page, I encounter an infinite loop in ...

Leveraging data from a JSON array

After successfully retrieving a JSON array from PHP using AJAX, I am now faced with the task of utilizing specific values within the array. Although I can currently display the results as a string, my goal is to access and use individual values independen ...

In Protractor, mastering the technique to extract multiple values simultaneously is crucial for efficiently handling applications that receive a large amount of push notifications

I am currently developing an automation test using Protractor for an application that receives a large volume of push notifications. The issue I am facing is testing a simple logic. expect(A + B).toEqual(C); The problem arises because A, B, and C are sou ...

Tips on validating emails using mongoose

As a beginner with Mongoose, I have a code snippet here. How can I validate the text that appears after the @ symbol in an email before saving it to the database? var user = new User ({ firstName: String, lastName: String, email: String, ...

Adjust the vertical scaling of a container in CSS Grid to maintain aspect ratio similar to an <img>

I am attempting to recreate a demonstration where the house image scales as the viewport height decreases. However, instead of using an <img>, I would like to use a container that also includes absolutely positioned content (unable to provide all the ...

Utilizing BootStrap 3 to Display Dual Navigation Headers Side by Side in a Single Row

I need help with organizing my BootStrap 3 nav header. I want to move the single dropdown item to the far right, while keeping the rest of the main menu items aligned to the far left. Can someone guide me on how to achieve this? <nav class="navba ...

What is the best method for emulating ui-sref from an ng-swipe event?

State Change Triggered by Swipe: I am trying to change the state of my application using a swipe event. I have looked at the ui-router documentation which suggests using $state.go(), but I'm not sure if this is the best approach? QUESTION: How can I ...