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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:16:41+00:00 2026-05-29T20:16:41+00:00

Hi i am using the jqgrid in my struts2 hibernate application. I got all

  • 0

Hi i am using the jqgrid in my struts2 hibernate application. I got all the reponse correctly in my view page, i can see this via my firebus tool. But my issue is how could i print the value in grid. I will my jsp page reponse below this page.

Here is my script in my jsp page

       <script type="text/javascript">

jQuery(document).ready(function(){
  jQuery("#list2").jqGrid({ 
    url:'server.action?q=2', 
    datatype: "json", 
    colNames:['id','name'], 
    colModel:[ {name:'id',index:'id'}, 
               {name:'name',index:'name'}], 
    rowNum:10, 
    pager: '#pager2', 
    sortname: 'id', 
    viewrecords: true, 
    sortorder: "desc", 
    caption:"JSON Example" }); 
jQuery("#list2").jqGrid('navGrid','#pager2',{edit:false,add:false,del:false});
});

</script>

my reponse comee like this

{"allUsers":"success",
"allUsersViaScript":"success",
"cell":[
   {"id":1,"name":"Aaronsburg","stateCode":"39"},
   {"id":2,"name":"Abbeville","stateCode":"2"},
   {"id":3,"name":"Abbeville","stateCode":"11"},
   {"id":4,"name":"Abbeville","stateCode":"19"},
   {"id":5,"name":"Abbeville","stateCode":"26"},
   {"id":6,"name":"Abbeville","stateCode":"41"},
   {"id":7,"name":"Abbot","stateCode":"22"},
   {"id":8,"name":"Abbotsford","stateCode":"49"},
   {"id":9,"name":"Abbott","stateCode":"44"},
   {"id":10,"name":"Abbottstown","stateCode":"39"},
   {"id":11,"name":"Abbyville","stateCode":"17"},
   {"id":12,"name":"Abell","stateCode":"21"},
   {"id":13,"name":"Abercrombie","stateCode":"29"},
   {"id":14,"name":"Aberdeen","stateCode":"14"},
   {"id":15,"name":"Aberdeen","stateCode":"18"},
   {"id":16,"name":"Aberdeen","stateCode":"21"},
   {"id":17,"name":"Aberdeen","stateCode":"26"},
   {"id":18,"name":"Aberdeen","stateCode":"28"},
   {"id":19,"name":"Aberdeen","stateCode":"36"},
   {"id":20,"name":"Aberdeen","stateCode":"42"},
   {"id":21,"name":"Aberdeen","stateCode":"48"},
   {"id":22,"name":"Aberdeen Proving Ground","stateCode":"21"},
   {"id":23,"name":"Abernant","stateCode":"2"},
   {"id":24,"name":"Abernathy","stateCode":"44"},
   {"id":25,"name":"Abie","stateCode":"30"},
   {"id":26,"name":"Abilene","stateCode":"17"},
   {"id":27,"name":"Abilene","stateCode":"44"},
   {"id":28,"name":"Abingdon","stateCode":"15"},
   {"id":29,"name":"Abingdon","stateCode":"21"},
   {"id":30,"name":"Abingdon","stateCode":"46"},
   {"id":31,"name":"Abington","stateCode":"7"},
   {"id":32,"name":"Abington","stateCode":"20"},
   {"id":33,"name":"Abington","stateCode":"39"},
   {"id":34,"name":"Abiquiu","stateCode":"33"},
   {"id":35,"name":"Abita Springs","stateCode":"19"},
   {"id":36,"name":"Abrams","stateCode":"49"},
   {"id":37,"name":"Absaraka","stateCode":"29"},
   {"id":38,"name":"Absarokee","stateCode":"27"},
   {"id":39,"name":"Absecon","stateCode":"32"},
   {"id":40,"name":"Acampo","stateCode":"5"},
   {"id":41,"name":"Accident","stateCode":"21"},
   {"id":42,"name":"Accokeek","stateCode":"21"},
   {"id":43,"name":"Accomac","stateCode":"46"},
   {"id":44,"name":"Accord","stateCode":"20"},
   {"id":45,"name":"Accord","stateCode":"35"},
   {"id":46,"name":"Accoville","stateCode":"50"},
   {"id":47,"name":"Ace","stateCode":"44"},
   {"id":48,"name":"Achille","stateCode":"37"},
   {"id":49,"name":"Achilles","stateCode":"46"},
   {"id":50,"name":"Ackerly","stateCode":"44"}
],
"cityList":null,
"page":1,
"records":29738,
"rowNum":null,
"rows":50,
"total":595,
"userList":[],
"userList1":null
}

and also my struts.xml comes like this.

<action name="server" class="com.actions.userList" method="getAllUsersViaScript" >
   <result name="success" type="json" >/WEB-INF/list.jsp</result>
</action>

it is the code.

And also i have write the setter and getter for all my variables that i have initialised in my java page. Anyone have any idea about what is the mistake on my side.

EDIT#1

When i paste the code it is generate the jqgrid template in my jsp page but the data is not populate in the jqgrid evethouh i got all the data correctly in my console. The pagination and all working in the grid but the data i need to be listed i cannot insert into grid.

  • 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-29T20:16:46+00:00Added an answer on May 29, 2026 at 8:16 pm

    Use this in your html body part

     <table id="list2" cellpadding="0" cellspacing="0" class=child>    
    </table>
     <div id="pager2" class="scroll" style="height:50px"></div> 
     <table>
    

    EDIT :
    Ok Which Version of jqGrid are you using? As I can see you are not using “postData”.

    Check If below example from my working code :

      $grid = $("#table");
            $grid.jqGrid({
                url: '../../Services/BranchService.asmx/getBranches',
                datatype: 'json',
                mtype: 'POST',
                ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
                serializeGridData: function (postData) {
    
                    if (postData.searchField === undefined) postData.searchField = null;
                    if (postData.searchString === undefined) postData.searchString = null;
                    if (postData.searchOper === undefined) postData.searchOper = null;
                    //if (postData.filters === undefined) postData.filters = null;
                    return JSON.stringify(postData);
                },
    
                jsonReader: {
                    root: "d.rows",
                    page: "d.page",
                    total: "d.total",
                    records: "d.records",
                    id: "d.names"
                },
                colModel: [
                         { name: 'select', label: 'select' },                        
                         { name: 'code', label: 'Branch Code' },
                         { name: 'name', label: 'Branch Name' },
                         { name: 'status', label: 'Branch Status'}
    
                    ],
    
    
                rowNum: 10,
                rowList: [10, 20, 300],
                sortname: 'name',
                sortorder: "asc",
                pager: "#pager",
                viewrecords: true,
                gridview: true,
                rownumbers: true,
                height: 250,
                autowidth: true,
                caption: 'Branch List',              
    
            }).jqGrid('navGrid', '#pager', { edit: false, add: false, del: false, search: true });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jqGrid with the getChangedCells('all') to get an array of the rows in
I am using jqgrid in my application with pagination. In Mozilla,IE,chrome,safari it's showing vertical
I am using jqgrid. My page has three tabs and each tab contains a
I'm using jqGrid to build a custom inline entry widget on a page. The
I am using jqgrid and using the inline editing mode and can't figure out
I am using jqgrid on EF4 MVC3 (C#). I based search on this @Oleg
I am using jqgrid throughout my application. On two screens with inline edit, everything
I'm using jqGrid with mvc 2 like this: jQuery(#extension_grid).jqGrid({ url: '/Extension/Report', datatype: json, direction:
I'm using jqgrid with jquery-ui 'smoothness' theme, unfortunately with this theme the selected row
I'm using jqGrid with cell editing and a datepicker. All works well, except that

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.