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 7612065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:49:04+00:00 2026-05-31T01:49:04+00:00

I have an object which I’m filling with objects containing 2 table rows each.

  • 0

I have an object which I’m filling with objects containing 2 table rows each. Each “subobject” should be detached from the original table and “dropped” into a new table I’m creating, which should sit in a JQM table-subpage.

May sample contains 1 table with 5 rows, which I want to split into 3 subpages.

This is what I have:

var splitRows, takeAway;

// 3 is calculated by total-rows/rows-per-subpage 
for( i = 0; i < 3; i++ ){

    // my table object ends up looking like this
    // with each loop adding another object with 2 rows
    splitRows = [[tr.even, tr.odd], [tr.even, tr.odd]],

    // here I'm grabing the current object, which should be two rows
    takeAway = splitRows[i];

    // detach and wrap in new page
    newPage = takeAway.detach()
                 .wrap( "<div data-role='page' id='some"+i+"'><div data-role='content'><table id='" + tableId + "'></table></div></div>" )
                 .closest('div:jqmData(role="content")')
                 .prepend('<div data-role="header"><h1>hello</h1></div>')
                 .parent()
                 .appendTo( $.mobile.pageContainer);
    }

Question:
I’m not getting nested pages with a table containing two rows, but a nested page for each row with a table and this row only. Can anyone tell me what I’m doing wrong?

The for loop runs three times, which is correct, the takeAway variable also correctly get 2,2,1 rows, but then something is going wrong…

Edit:
still trying… I think it must be related to slice creating a new object with 2 elements, which each is wrapped and … only each is not specified anywhere… so I would change my question to how to make wrap multiple elements at once?

  • 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-05-31T01:49:05+00:00Added an answer on May 31, 2026 at 1:49 am

    got it… to wrap multiple elements in one wrap, use wrapAll() instead of simply wrap().

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

Sidebar

Related Questions

I have an object which I want to rotate via keys. The object should
I have an object which holds a stack of objects. The object represents the
I have an object which is derived from DependencyObject with multiple DependencyProperties. This object
I have an object which has inner objects and properties defined like this: var
I have a object which i looked from firebug looks like following var object
I have an object which itself has multiple objects as fields. The question I
I have an object which has a property that contains an IEnumerable of objects.
I have an object which will be constructed from fields in an SQLite database
In my web app I have an object which is built from a JSON
i have an object which represents a database table. I want to iterate through

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.