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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:42:24+00:00 2026-05-19T15:42:24+00:00

I have a dilemma, and I could really use some advice. I am building

  • 0

I have a dilemma, and I could really use some advice.
I am building an ordering system with PHP/Smarty/HTML/jQuery.
Currently working on the site where the seller will confirm orders.

I need to have 3 divs.

  1. Waiting orders div – contains a table with unprocessed orders
  2. Last orders div – contains a table with last processed orders (10-20 rows)
  3. Details div – contains information about the order, and buttons to confirm/decline

It’s a typical master-detail situation, only the master is split into 2 parts (1,2) and details is in div 3.
Naturally everything is connected with javascript/Ajax so the user can get the “real-time” feeling.
Waiting orders div is filled via comet (long-polling) technique.

My dilemma is how to connect the divs with javascript/ajax. Should I make echo pages which correspond to the db state and load the completely in divs. Or should I manipulate just the table rows and use ajax only for background db calls?

To make myself more clear:

Option 1 (Ajax complete pages):

  • when the user selects the waiting order, new page (echoed table) is fetched with ajax and loaded into details div
  • when the user confirms/declines the order in div 3, divs 1 and 2 are refreshed with ajax (echo pages with tables which correspond to the state in db)

Option 2 (html manipulation/background Ajax):

  • when the user selects the waiting order, elements of div 3 are filled with new value.
  • when the user confirms/declines in the order in div3, tr from table in div 1 is removed (background ajax to del from db) and the same tr is added in div 2 (background ajax to insert to db)

So which way to go?

  • 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-19T15:42:24+00:00Added an answer on May 19, 2026 at 3:42 pm

    Both ways are acceptabale, but nr 1 is less user friendly, because of reload div 1&2. When you load something into div 3, you have its id so it should be a problem to copy / append tr (and add color, so user know what happened).

    If you choose 2 remember to unbind / bind new actions to your tr elements, because when you move your tr to another place it will not trigger actions you binded earlier.

    I would probably go with 2 myself 😉

    PS. Add overlay with ajax loader (http://ajaxload.info/), to be on the safe side from user interuptions, while you are loading data into div 3. User will be happier as well, because he will know that something is going on 😉

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

Sidebar

Related Questions

i have little dilemma, i often use data-bound controls such as Gridview in conjunction
I'm having something of a dilemma and would appreciate some input. I have this
If you could help me with this dilemma I have. Now, I know C
I have dilemma on the format of method parameters for a function in PHP
I have a dilemma on my hands. After much trial and error, I still
We have a dilemma; developing desktop application using Matisse or Jigloo.. Matisse has this
I have a dilemma that I've encountered before. What's the best in terms of
I have a dilemma. Let's assume(for simplicity's sake) I have four tables, with different
I have this dilemma many times - and I would like one time and
Okay - I have a dilemma. So far my script converts page titles into

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.