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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:45:00+00:00 2026-05-23T17:45:00+00:00

I have 3 different tabs where i am displaying data using jQGrids(each tab contain

  • 0

I have 3 different tabs where i am displaying data using jQGrids(each tab contain one grid).

But i just thought that my grids are completely the same, only the difference is that they using different url to get data.

So I have three similar girds on each tab only with different urls:

First: url: '/Home/GetData?id=1' Second: url: '/Home/GetData?id=2' and Third: url: '/Home/GetData?id=3'

So i was thinking that may be i may declare grid only once and than on each tab click a can pass the url to load data? So on each tab click jQGrid will be populating from the new url.

May be some one may have any ideas about that?

Or may be some one may have better ideas how to reduce “jQGrid copy-paste” in that case?

UPDATE 0:

Nearly get it work i mean it is working but there is one small problem,
When i am switching tabs the header of the grid getting lost…and some jqgrid formatting as well.

here is my code:

$("#tabs").tabs({
            show: function (event, ui) {

                if (ui.index == 0) {
                    //$("#Grid1").appendTo("#tab1");
                    //$("#Grid1Pager").appendTo("#tab1");

                   //When Appending only pager and grid div, header getting lost so i've append the whole grid html instead
                   $("#gbox_Grid1").appendTo("#tab1");

                   changeGrid("#Grid1", 1);
                }

                else if (ui.index == 1) {
                  //$("#Grid1").appendTo("#tab2");
                  //$("#Grid1Pager").appendTo("#tab2");

                  $("#gbox_Grid1").appendTo("#tab2");

                  changeGrid("#Grid1", 2);
                }

                else if (ui.index == 2) {
                    //$("#Grid1").appendTo("#tab3");
                    //$("#Grid1Pager").appendTo("#tab3");

                    $("#gbox_Grid1").appendTo("#tab3");

                    changeGrid("#Grid1", 3);
                }
            }
        });

function changeGrid(grid, id) {
        $(grid).jqGrid('setGridParam', {
            url: '/Home/GetData?id=' + id
        });

        $(grid).trigger('reloadGrid');
    }

UPDATE 1

All right, i’ve changed the code to append the whole grid instead of appending grid div and pager only. So it is working like that.

  • 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-23T17:45:01+00:00Added an answer on May 23, 2026 at 5:45 pm

    You can basically make the tabs as regular buttons that will call some function which sets new URL parameter to the grid and reloads it.

    The function should be something like this:

    function changeGrid(grid, id) {
       $(grid).jqGrid('setGridParam', {
          url: '/Home/GetData?id=' + id, page: 1
       });
       $(grid).trigger('reloadGrid');
    }
    

    Note that I set the page to 1. Keep in mind that you might need to set the default sorting column or something similar depending on your solution.

    UPDATE

    If you really want to go with the tabs, the ‘show’ event handler can be simplified.
    Try this:

    $("#tabs").tabs({
        show: function (event, ui) {
            var id = ui.index + 1;
    
            $("#gbox_Grid1").appendTo("#tab" + id);
    
            $("#Grid1").jqGrid('setGridParam', {
                url: '/Home/GetData?id=' + id
            });
            $("#Grid1").trigger('reloadGrid');
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several tabs in my application, and each tab loads a different sub-page
I have a TabControl that contains several tabs. Each tab has one UserControl on
I have two lists, each on different tabs (sub-sites) of the site. I would
I have a webpage that implements a set of tabs each showing different content.
I have a page where I have 4 tabs displaying 4 different reports based
I have a tab control on a form, and a couple different tabs have
I am using jqgrid. My page has three tabs and each tab contains a
I have a TabContainer with different tabs (ContentPanes). I am loading each type dynamically
I have created a Tabbar Application using Xcode. I have 5 different tabs and
I have a program with 4 different tabs. One of these tabs is an

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.