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

  • Home
  • SEARCH
  • 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 1085817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:44:11+00:00 2026-05-16T22:44:11+00:00

I have a grid displaying some information and when I select multiple rows and

  • 0

I have a grid displaying some information and when I select multiple rows and click on add order button it should display those rows in 2nd grid without making any call because its just show the selected row from 1st to 2nd grid….just like shopping cart application ? Is it possible with jqGrid?

Moreover, if I selected more rows it should append in that 2nd grid.

If anyone have any idea about how to achieve it ..I will really appreaciate…Thanks!

  • 1 1 Answer
  • 1 View
  • 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-16T22:44:11+00:00Added an answer on May 16, 2026 at 10:44 pm

    It seems to me that addRowData method come to your requirement better as other. Let us the 2nd grid has the same columns as the 1st grid. Then in the ‘click’ event handle of the “add to shopping cart” button you can do like following

    var gridProducts = $("products");
    var gridShoppingCart = $("cart");
    var prodIds = gridProducts.jqGrid('getGridParam', 'selarrrow');
    for (var iProd=0, lProd=prodIds.length; iProd<lProd; iProd++) {
        var prodId = prodIds[iProd];
        var prodData = gridProducts.jqGrid('getRowData', prodId);
        gridShoppingCart.jqGrid('addRowData', prodId, prodData);
    }
    

    The real shopping cart should have probably an item count. If one adds the same product twice the item counter should be incremented instead of having two products (with the same id) twice in the 2nd grid.

    Let us in the 2nd grid we have a column with the name ‘count’. In JavaScript is very easy to add a property to the object, so we can easy modified the code above to the following

    var gridProducts = $("products");
    var gridShoppingCart = $("cart");
    var prodIds = gridProducts.jqGrid('getGridParam', 'selarrrow');
    for (var iProd=0, lProd=prodIds.length; iProd<lProd; iProd++) {
        var prodId = prodIds[iProd];
        var prodData = gridProducts.jqGrid('getRowData', prodId);
        var cnt = gridShoppingCart.jqGrid('getCell', prodId, 'count');
        if (cnt) { // product exist
            gridShoppingCart.jqGrid('setCell', prodId, cnt+1);
        } else {
            prodData.count = 1;
            gridShoppingCart.jqGrid('addRowData', prodId, prodData);
        }
    }
    

    I don’t test the code examples above, but I hope they will work.

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

Sidebar

Related Questions

We have a web part on which we display some data in a grid.
I have grid with some textboxes and an image which goes out of grid
I have a grid which I would like to show extra information with RowExpander
I have a grid with some controls inside. I want to hide the grid
I have a grid of profile pictures I am displaying in a window that
I have an image control inside a grid displaying a 16x16 icon. But for
I have a code which is working fine and displaying some set of values
I have a table which I'm displaying in a grid. I'm being asked to
I want to add attributes (like Browsable(false)) dynamically while displaying in the grid. Scenario
I have jqGrid with some columns, I want to add additional fields in Add

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.