Efficiently manage large datasets with Vue.js using the expand/collapse list AJAX pattern

Within my vuejs application, there is a page where I aim to showcase a list of clients. When a user expands an individual client row, it should reveal a list of proposals specific to that client. Additionally, there is an expand/collapse functionality for all clients, allowing users to expand or collapse all rows in the table at once. The challenge lies in the fact that the dataset containing all client and proposal information is quite large, resulting in significant load times.

To address this performance issue, I have opted to initially load only the list of clients. When a user clicks on a particular client, the component responsible for displaying proposal data makes an axios call to fetch the necessary information specifically for that client.

The main drawback to this approach is that when attempting to expand all clients, a high volume of ajax requests are triggered by the numerous component instances. This can overwhelm the browser's ability to effectively manage and throttle these requests.

I am seeking advice on how best to resolve this issue within the given use case.

Answer №1

  1. Enhance your server by implementing a feature that generates and sends one large chunk of data to reduce delay caused by frequent client requests and TCP connections.
  2. Incorporate a loading window or spinner with adjustable delay times between requests, tailored to the specific number of requests being processed.

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

Magnific Popup displaying only the initial item

As someone new to using jQuery and Magnific Popup, I am working on a grid of images. When an image is clicked, I want Magnific Popup to display a specific div containing information relevant to that particular image. <div class="grid"> <div c ...

Using Jquery Ajax to validate login information by submitting an HTML form

Working on a project involving jQuery Ajax, HTML forms, MySQL, and PHP. I have a database with registered users and I want to use a login form to retrieve user information from the database upon submission. However, I'm encountering an issue where the ...

Display a Bootstrap input button group addon, where the first button has rounded corners only after the second button has been hidden

I am working on a button group and need to hide the second button dynamically. However, I am facing an issue where the first button has a 90° border. How can I adjust the code below to display button 1 with a rounded border? If I decide to hide "button ...

Searching for a specific element within a JSON object by iterating through it with JavaScript

Here is the JSON file I am working with: { "src": "Dvc", "rte": { "src": "dvc" }, "msgTyp": "dvc.act", "srcTyp": "dvc.act", "cntxt": "", "obj": { "clbcks": [ { "type": "", "title": "", "fields": [ { "src": "label.PNG", ...

Preventing unauthorized access to files in ExpressJS public directories

Is there a way to conceal files served by the Node server? Despite my attempts to redirect certain files and directories, Express 4.X does not seem to cooperate. I have also experimented with sending 4XX HTTP responses when specific files are requested, bu ...

Scroll the div that is dynamically filled without affecting the scrolling of the main page

My current struggle involves using iScroll in my web project. The goal is to populate a list with articles and slide in a div over the list to display the selected article. While the basic functionality is in place, I face an issue where scrolling through ...

Troubleshooting Issue with InfoWindow Display on Multiple Markers in Google Maps

I'm having trouble getting my markers to show different infowindows. No matter what I do, the markers always display the content of the last "contentString" in the loop. Despite reading through multiple posts on this issue, I haven't been able t ...

Obtaining additional information through ajax in Yii2

I have encountered an issue where, while receiving data from an ajax call, I am also getting unnecessary data such as all the contents of my PHP files. The problem is illustrated in the image below. How can I resolve this issue? https://i.stack.imgur.com ...

Error message occurred in Laravel, specifically in the foreach loop, when integrating with Vue.js due to incorrect

I need to save my data in the database for two tables: Cashoutdetails and Cashout expenses. While I am able to store data for Cashoutdetails without any issues, I encounter an error when trying to store data for the cashout expenses table. Below is the cod ...

Prevent scrolling in Drupal when a modal is opened

Including multiple blocks on a single page that display login and subscribe buttons: $form['btn_actions']['subscribe_for_free_btn'] = [ '#type' => 'link', '#title' => ...

Incorporate information into a React component

I'm currently working on my initial react component and facing a challenge while adding items to the parent element through an external click event. The user needs to select from a list of search results, and I intend for these selections to be incorp ...

Is React failing to insert a span element in the client-side code?

First off, I'm a beginner in the world of react and recently tackled this guide on creating a real-time Twitter stream To cut to the chase, I wanted to include a link next to each tweet that followed its text. To achieve this, I simply added props to ...

What is the process for configuring environmental variables within my client-side code?

Is there a reliable method to set a different key based on whether we are in development or production environments when working with client-side programs that lack an inherent runtime environment? Appreciate any suggestions! ...

Overcoming Troublesome Login Input Box in Web

In an effort to streamline tasks in our office, I am working on automating certain processes. Specifically, this program is designed to log into our insurance company's website and extract information for payroll purposes. Below is the code snippet th ...

How can I transfer a collection of JSON objects from JavaScript to C#?

Feeling a bit confused here. I have some Javascript code that will generate JSON data like the following: {type:"book" , author: "Lian", Publisher: "ABC"} {type:"Newspaper", author: "Noke"} This is just one example, I actually have more data than thi ...

Rearranging components in React does not automatically prompt a re-render of the page

I'm currently working on a project to display the update status of my Heroku apps. The issue I encountered was that the parent component (Herokus) was determining the order, but I wanted them sorted based on their update dates starting from the most r ...

What is the memory allocation for null values in arrays by node.js?

Continuing the discussion from this thread: Do lots of null values in an array pose any harm? I experimented with node.js by doing this: arr=[] arr[1000]=1 arr[1000000000]=2 arr.sort() However, I encountered the following error: FATAL ERROR: JS Alloca ...

"Adjusting the AJAX call destination based on the current view or page: A step-by-step guide

I am currently conducting tests on a .js script using Qunit. Within my static .html test harness, I have included the .js "code under test" (CUT) along with appropriate markup. The actual testing is happening in another script that is also incorporated in ...

Discovering Ajax-powered websites Here are some tips on identifying websites

My goal is to determine if a webpage makes AJAX calls. If the webpage is AJAX-based, I will wait for a few seconds to retrieve the content. If it's not AJAX-based, then I won't wait. I attempted the code below, but it didn't yield any resul ...

Unable to retrieve component post server request - MERN

When validating the route /users using a router, I am using the render function: <Router> <Switch> <Route path = "/" exact component = {Home}></Route> <Route path = "/login" co ...