Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8707623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:54:59+00:00 2026-06-13T03:54:59+00:00

So, I am asking about how to create the appropriate concept/solution for a problem

  • 0

So, I am asking about how to create the appropriate concept/solution for a problem I have coming up. I am pretty sure I an cover it, but after talking with some on here, I see there are more than one way to skin a cat, and more often – better. lol.

So, I have some data coming in.. via ajax call. Ok great. That all gets bundled in a basket that I think create page paginations.

For instance, I get a bucket of 4 items, and my pagination is 2 per page.. equals 2 pages. I only build the pages one pagination is clicked.. I have the data, but then I build it out. (for the sake of the example below).

So here is my issue. I have a second set of data that i must retrieve (it is a seperate ajax call) and that second set of data might append additional data to the first set of items.

How best to map that second set to the first even when their display is not built yet.

So, – for the sake of argument, I have my first set of data that i just received. Lets say there is only 2 items per page.

In total, my first bucket has the following data:

data = [
{name:ITEM1, desc: Greatest Book in History, id: 98987 },
{name:ITEM2, desc: Second Greatest Book in History, id: 76557 },
{name:ITEM3, desc: Third Greatest Book in History, id: 121212 },
{name:ITEM4, desc: Fourth Greatest Book in History, id: 09546 }

]

page one.


ITEM 1 - Greatest Book in history
ITEM 2 - Second Greatest Book in history

Page 2 pagination is clicked


ITEM 3 - Third Book in history (**special sale: Special Edition**)
ITEM 4 - Fourth Greatest Book in history

Now, my second second data has the following

specialData = [
{121212 : special sale: Special Edition}
]

So, the second ajax call is gonna send all my First Bucket IDS and get returned any “new” information that is available. If there is, I am gonna append the display with the new data.

Now, my guess to do this is:

1). Wait for the second request to finish then append the first bucket data with the second set of info, so when I build out the pagination, the data is there gets build as pagination is requested.

or

2). Build the first bucket of data as normal and then apply an * element id * that is the same as the item id number…. and when the second data bucket is fetched, I append to the html element id with the new info.. that is how I find the appropriate match. THe only thing is, I have to know that that particular element ID dom item is present (visible/built to the current pagination page) before I can append that new info.

<div>ITEM 3 - Third Book in history<span id="121212"></span></div>

What am I missing here? Is this simpler than I am making it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:55:00+00:00Added an answer on June 13, 2026 at 3:55 am

    I’d probably go with the second approach for both cleanliness and the nature of the data structures provided by JavaScript. Given you’ve tagged the question with jQuery, here is an implementation.

        var dataBucket = {};
        function enrichBucket(incomingData) {
            for(var i = 0, len = incomingData.length; i < len; i++) {
                var dataEntry = incomingData[i];
                dataBucket[dataEntry.id] = $.extend( dataBucket[dataEntry.id]||{}, dataEntry);
            }
        }
    

    http://api.jquery.com/jQuery.extend/ Check out the [deep] flag if you want to do a deep merge.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen several questions with people asking about the same problem but none
I have seen questions here asking about xsd->actionscript objects, but these seem to require
I have found several questions asking about template typedefs in C++0x, which are resolved
Asking about eventemitters in node.js For different events, should I create new emitters on
I'm pretty confused on how to go about this. Say I have two columns
I'm just asking about this instruction: String[][] s = new String[2][2]; If i create
After asking about what Visual Studio does to register a COM Library , it
Similar to this question asking about relatively light-weight data entry / editor application development,
I am asking about the static binding of the function in C++. What's the
i just was asking about the existence of a headfirst book(iPhone&iPad development) which covers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.