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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:50:57+00:00 2026-06-18T04:50:57+00:00

I am using JQgrid for display my data with grouping and sorting. When my

  • 0

I am using JQgrid for display my data with grouping and sorting.
When my page is loaded, it does not show grouping at all.
But, it works fine after i do sorting on column, it displays grouping. I want grouping displayed on my page load.
Also i am confusing with css and js files used. Below is my code. Please help me.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<link rel="stylesheet" type="text/css" media="screen" href="css/ui-lightness/jquery-ui-1.8.2.custom.css" />

<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />

<link rel="stylesheet" type="text/css" media="screen" href="/js/src/css/ui.multiselect.css" />

<link rel="stylesheet" type="text/css" media="screen" href="themes/basic/grid.css" />

<link rel="stylesheet" type="text/css" media="screen" href="themes/jqModal.css" />

 <style type="text">
        html, body {
        margin: 0;            /* Remove body margin/padding */
        padding: 0;
        overflow: hidden;    /* Remove scroll bars on browser window */
        font-size: 75%;
        }
    </style> 

<!--<script src="js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>-->



<script type="text/javascript" src="js/jquery.jqGrid.min.js"></script>

<!--<script src="js/jquery-1.4.2.js" type="text/javascript"></script>-->

<script src="js/jquery.js"  type="text/javascript"></script>

<script src="js/jquery.jqGrid.js" type="text/javascript"></script>

<script src="js/src/jqModal.js" type="text/javascript"></script>

<script src="js/src/jqDnR.js" type="text/javascript"></script>

<script src="js/ui.multiselect.js" type="text/javascript"></script>

<script src="js/jquery.tablednd.js" type="text/javascript"></script>

<script src="js/jquery.contextMenu.js"  type="text/javascript"></script>

<script src="js/jquery.layout.js" type="text/javascript"></script>

<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>

<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $("#list4").jGrid.no_legacy_api = true; 
    </script>

<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="js/src/grid.loader.js" type="text/javascript"></script>


<script type="text/javascript">

   $(function(){ 
  $("#list4").jqGrid({

                        data: mydata,
                        datatype: "local",
                        height: 'auto',
                       colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], 
                       colModel:[ {name:'id',index:'id', width:60, sorttype:"int"}, 
                       {name:'invdate',index:'invdate', width:90, sorttype:"date", formatter:"date"}, 
                       {name:'name',index:'name', width:100, editable:true}, 
                       {name:'amount',index:'amount', width:80, align:"right",sorttype:"float", formatter:"number", editable:true}, 
                 {name:'tax',index:'tax', width:80, align:"right",sorttype:"float", editable:true}, 
                 {name:'total',index:'total', width:80,align:"right",sorttype:"float"}, 
                 {name:'note',index:'note', width:150, sortable:false} ],
                                pager: '#pager',
                                rowNum:30,
                                rowList:[10,20,30],                               
                                loadonce: true,
            sortable:true, 
                                viewrecords: true,                                
                                imgpath: "themes/basic/images",
                               caption: "Grouping Array Data",
                               sortname: 'name',
                               grouping:true, 
        groupingView : { groupField : ['name'], groupColumnShow : [true],groupOrder : ['asc'],groupText : ['<b>{0}</b>', '{0}'] },
        groupDataSorted : true,
         plusicon: 'bullet_toggle_plus',
    minusicon: 'bullet_toggle_minus'
        //Required for client side sorting
//    loadonce: true,

    }    
            );


   var mydata = [ {id:"1",invdate:"2010-05-24",name:"test",note:"note",tax:"10.00",total:"2111.00"} , 
   {id:"2",invdate:"2010-05-25",name:"test2",note:"note2",tax:"20.00",total:"320.00"}, 
   {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",tax:"30.00",total:"430.00"}, 
   {id:"4",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"}, 
   {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",tax:"20.00",total:"320.00"}, 
   {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",tax:"30.00",total:"430.00"}, 
   {id:"7",invdate:"2007-10-04",name:"test",note:"note",tax:"10.00",total:"210.00"}, 
   {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"21.00",total:"320.00"}, 
   {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, 
   {id:"11",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, 
   {id:"12",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, 
   {id:"13",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, 
   {id:"14",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, 
   {id:"15",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, 
   {id:"16",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, 
   {id:"17",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, 
   {id:"18",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, 
   {id:"19",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, 
   {id:"21",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, 
   {id:"22",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, 
   {id:"23",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
    {id:"24",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, 
    {id:"25",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, 
    {id:"26",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, 
    {id:"27",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, 
    {id:"28",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, 
    {id:"29",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"} ];


        for(var i=0;i<=mydata.length;i++)
            jQuery("#list4").addRowData(i, mydata[i]);              
            }//function
    );//ready
 $("#list4").jqGrid().setGridParam({sortname: 'Date,', sortorder: 
'asc'}).trigger("reloadGrid");    

</script>
</head>

<body>

This is table

<table id="list4">

</table>

<div id="pager" class="scroll" style="text-align:center;">

</div>

This is table

</body>
</html>
  • 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-18T04:50:58+00:00Added an answer on June 18, 2026 at 4:50 am

    Finally i found answer of my question itself.
    Array declaration and manipulation loop should be inside of anonymous function jQuery(document).ready(function(){…}), and not outside of it. This way it will be executed after jqQrid initialization and not before.

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

Sidebar

Related Questions

I use jqGrid to display data which is retrieved using NHibernate. jqGrid does paging
I'm using jqGrid to display some data on a page. Within the controller action,
I am using jqGrid ( http://www.trirand.com/blog/ ) to display some read-only data. The resizeable
I am using jqgrid to display data i need Click Here to Edit in
I'm currently using jqGrid to display data. Part of jqGrid's interface will give you
I'm using JQGrid to display my data (the server returns xml). The data seems
I am using Jqgrid to display my data into jqgrid using web services in
I am Using JQGrid to display some list of data from db depending on
I'm using jqGrid to display some data to users. jqGrid has search functionality that
My problem is the following : - i'm using jqgrid to display local data

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.