What is the best way to create collapsible rows in AngularJS with ng-repeat?

In my current project, I am utilizing ng-repeat to display objects in rows. To achieve my desired functionality of only displaying elements present in the DOM, I decided to use a helpful plugin called angular-vs-repeat. However, I am facing an issue with unwanted space appearing between the rows. I am unsure of where this space is coming from and I need to remove it. If you have any insights or suggestions, please let me know.

 <div vs-repeat class="repeater-container">
          <div class="row" ng-repeat="column in invoice_records " ng-class-odd="'odd-row'">
            <div class="col brd collapse-sm" ng-repeat="field in column.columns" ng-show="invoice_column_name[$index].checked && invoice_column_name[$index].fieldNameOrPath===field.fieldNameOrPath">{{field.value}}</div>
            <div class="col col-10 text-center brd collapse-sm"></div>
          </div>
          </div>

You can view my code and see the issue in action here. For more information on the plugin I am using, visit this link.

Answer №1

The extra space is a result of the fixed "top" property. Adjusting these values will either increase or decrease the space between rows.

Update: The root cause was actually the margin and padding settings. I created a new class to reset them.

For reference, here is the link to the plnkr: "http://plnkr.co/edit/PqSmlAuAF25kFid8V7jW?p=preview".

.new-class{
  margin-top : 0px;
  padding-top : 0px;
  padding-bottom: 0px;
}

Below is the updated HTML:

<div class="row new-class" ng-repeat="column in invoice_records " ng-class-odd="'odd-row'">

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

By default, the select option in AngularJS will have a value of either an object or null

This block of code is located in the js file: $scope.ListOption = []; $scope.ListOption.push({ Value: "0", Name: Car }); $scope.ListOption.push({ Value: "1", Name: House }); Below is the corresponding HTML code: <select class="form-control" id="Categ ...

"Learn how to convert basic input fields into user-friendly Bootstrap input groups using the power of jQuery

Is there a way to use jQuery to convert my basic input field into a bootstrap input-group like the one shown below? This is how I created the input: <div class='input-group date' id='ff'> <input type='text' class= ...

What is the best way to display index.ejs when the input field is blank?

If the input field is left empty when I click the form button, I want to redirect to "/". After clicking the button, the desired URL should be: http://localhost:3000 Header.ejs <form action="/search" method="GET"> < ...

Centering an item using Bootstrap

I am using bootstrap in reactjs and attempting to center a text in the middle of the screen, but it seems to not be working. Can someone please point out what I am doing wrong? <div className="h-100 d-flex align-self-center justify-content-center&q ...

Displaying Angular JS 1.5 component's HTML content in the browser as a commented-out section

Exploring the Angular world and facing a challenging issue with a basic angular component. My goal is to incorporate a custom element called "cast-tile" on the page, loaded by angular as a component. However, the browser seems to be treating the code in n ...

Scrolling automatically to a DIV is possible with jQuery, however, this feature is functional only on the initial

I'm currently working on a Quiz site and I've encountered a puzzling issue. Since the explanation only appears after an answer is selected - essentially a "hidden" element, I decided to wrap that explanation into a visible DIV. The code I'v ...

Guide on creating an autonomous select-all checkbox to show table columns

How can I create checkboxes with a "Select all" option and the following functionality: Check one or more checkboxes to show specific table columns. Uncheck them to hide the columns (toggle). Select the "Select all" checkbox to display all table columns. ...

Guide on retrieving documents from a collection in mongodb by utilizing the $nin operator

My user schema looks like this const userSchema= new mongoose.Schema({ Username:{ type:String, trim:true, required:true }, email:{ type:String, trim:true, required:true }, hashed_password:{ type:String, trim:t ...

Adding to the beginning of a list in JQuery mobile

Having trouble figuring out how to prepend my list in jQuery mobile while keeping the divider on top of the most recent item added. I attempted to prepend the newly added item, but it ended up shifting the divider to the bottom instead. function loadScan ...

Chaining promises allows you to utilize the outcome of one request to make another

I've been experimenting with ES6 in node.js and want to transition from using callbacks to promises. I created a test project to fetch an oauth2 token from an api/endpoint, refresh it, and then revoke it. My code snippet is as follows: const oauth2Ad ...

Tips on implementing the onChange event in a custom text input for React Native applications

Recently, I started exploring React Native and attempted to create a custom text input with suggestions following a tutorial. However, I encountered an issue where I couldn't use onChange on my custom text input. I attempted to set up a state in App.j ...

Is there a way to obtain the function associated with an onclick attribute?

I have a function attached to the onclick event in the HTML, as shown below: <script> function f1(){ alert('hello world'); }; </script> <a onclick="f1()">test</a> I want to manipulate that function by binding it to ...

Discovering the URL of an AJAX request on any given website

Is there a way to retrieve the URLs of AJAX requests that are sent by the current page on a website using a browser or another tool? ...

Maintaining awareness of which accordion drawer is currently open within a React application

Just getting started with coding, I recently created a collapsible accordion in a NextJs app using the react-collapse package. Everything seems to be working fine, but I'm running into an issue with keeping track of which 'drawer' is current ...

Trouble with jQuery noConflict function not resolving as expected

I'm attempting to use both jQuery 1.4 and 2.0 by utilizing the noConflict function, but the code isn't working as expected. Here is an example of my document head: <script src="js/jquery-2.0.0.min.js" type="text/javascript"></script> ...

Troubleshooting: Magento checkout page keeps scrolling to the top

We are experiencing an issue where, during the one page checkout process, the next step is not automatically scrolling to the top of the page when it loads. After a user fills out all their billing information and clicks continue, the next step appears ha ...

Issues arise when attempting to send an AJAX POST request within WordPress

After going through multiple resources, all mentioning the same approach that I am following, I have two essential files for this process: In the receiver.php file: <?php add_action( 'wp_enqueue_scripts', 'my_enqueue' ); ad ...

"Applying a background color to a BorderPane element is successful when done inline, but encounters issues when

So I have a border pane and I am trying to set its background color to black using CSS. When I directly set the style inline, like this: borderPane.setStyle("-fx-background-color: black;"); it works perfectly fine. However, when I try to add a class s ...

The data contained in the Response is an extensive script instead of the intended JSON object

Currently, I am in the process of developing a web application using Laravel and Vue.js. In order to retrieve a list of users, I have implemented an axios GET request. However, the response I am receiving is in the form of a Promise object, which I have le ...

Heroku deployment of rails application is failing to recognize CSS

Having faced the same issue time and time again, I am reaching out for help. I have exhausted all possible solutions, but my heroku app at still lacks proper CSS styling. Here is a snippet from my gemfile: source 'https://rubygems.org' # Bundl ...