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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:28:25+00:00 2026-06-09T18:28:25+00:00

My Response data looks like this {page:1,total:10,records:8,message:null,rowdata: [{status:null,contactNo:null,approvalStatus:null,userInfoID:32,userName:bbb 1234,userFullName:bbb 1234,profiles:[{profileInfoID:10,profileName:Profile Ganda},{profileInfoID:15,profileName:Sample Profile 123}]}, {status:null,contactNo:null,approvalStatus:null,userInfoID:28,userName:

  • 0

My Response data looks like this

{"page":"1","total":"10","records":"8","message":null,"rowdata":
[{"status":null,"contactNo":null,"approvalStatus":null,"userInfoID":32,"userName":"bbb
1234","userFullName":"bbb 1234","profiles":[{"profileInfoID":10,"profileName":"Profile 
Ganda"},{"profileInfoID":15,"profileName":"Sample Profile 123"}]},
{"status":null,"contactNo":null,"approvalStatus":null,"userInfoID":28,"userName":
"yyyy1234","userFullName":"yyyy 1234","profiles":       
"profileInfoID":10,"profileName":"Profile Ganda"}]},.......]}

I have got the response using AJAX and passed the response data to the Jqgrid and set the data type as local and the code is given below.

function buildUserGridAttach(response){
var jq = jQuery.noConflict();  
 jq("#attachTable").jqGrid({
 url:"searchUsers.htm",
 data: response.rowdata, 
 datatype: "local",
 mtype:"post",
 width: 1100,
 height: "auto",
 rowNum: 5,
 rowList: [5, 10, 20],
 viewrecords: true,
 rownumbers: false,
 toppager: true,
 bottompager:true,
 pager: jQuery("#resultsPagerAttach"),
 sortname: "userName",
 sortorder: "asc",
 caption: "Search Results",
   // Specify the column names
   colNames: ["Select","User ID", "User Name", "Profiles"],
   // Configure the columns
   colModel: [
   { name: "userInfoID",hidden:true,index: "userInfoID",editable:true, width: 25},                           
   { name: "userName", index: "userName", width: 25, align: "left", search:true, sorttype:'text',title:false},
   { name: "userFullName", index: "userFullName", width: 25,  align: "left" ,search:false, sorttype:'text'},
   { name:"profiles", index:"profiles", width:60, editable: true,edittype:"select",editoptions:{multiple:true,width:50} },       
   ],

   // Grid total width and height
   autowidth: true,
   height: 300,       
   // Paging
   rownumbers: true,
   toppager: true,
   bottompager : true,
   pager: jq("#paging"),
   rowNum: 5,
   rowList: [5, 10, 20],
   viewrecords: true, // Specify if "total number of records" is

   // Default sorting
   sortname: "userName",
   sortorder: "asc",
   hidegrid: false,
   emptyrecords: "No records to view",

   // Grid caption
   caption: "Search Results", 
   multiselect:true,

   gridComplete: function() {
     var grid = jQuery("#attachTable");         
      jQuery.each(response.rowdata, function(ID,row) {
         var rowId = (ID+1);
         grid.editRow(rowId, true);
         var de = "<select  style='width: 150px;' name=" + rowId + " id=" + rowId + " multiple=true >";               
         jQuery.each(row.profiles, function(Id,profile ) {
              de = de + '<option value="' + row.userInfoID +  ":" + profile.profileInfoID + '">'+ profile.profileName+'</option>';  
          }); 
         de = de + '</select>';
       //  de = de + "<input type=hidden id='userInfoID' value='"+ row.userInfoID + "'>";
         jQuery("#attachTable").jqGrid('setRowData', rowId, { profiles: de });
         jQuery("#attachTable").jqGrid('setRowData', rowId, { userInfoID: row.userInfoID});
         jQuery("#attachTable").jqGrid('setRowData', rowId, { userName: row.userName });
         jQuery("#attachTable").jqGrid('setRowData', rowId, { userFullName: row.userFullName});
        }); 
   },   
   jsonReader : {root: "rowdata", page: "page", total: "total", records: "records", repeatitems: false, id: "userInfoID"}
 });   
}

The data is populated correctly and I am able to do all the manipulations on the grid. The problem initially I faced is I am not able to reload the grid with the new Data.
After reading a lot of forums, I have tried with

grid.jqGrid('clearGridData').jqGrid('setGridParam', { data: response.rowdata})
.trigger('reloadGrid', [{ page: 1}]);

The above command works good and the data is reloaded. But when the gridComplete function is called, the previous data overrides the new data. This error I found out after commenting out the gridComplete function.

I need to solve this. I have been working on this for the past 3 days.

My JqGrid table looks as below.

http://i49.tinypic.com/2n9fsx.png

  • 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-09T18:28:26+00:00Added an answer on June 9, 2026 at 6:28 pm

    Try use GridUnload and then build the same grid again. Do something like:

    jQuery("#attachTable").jqGrid("GridUnload");
    buildUserGridAttach(response);
    

    This is brutal, but should be working.

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

Sidebar

Related Questions

The response data in my test has this line: <head><title> My Title </title><meta charset
Could someone tell me why this code does not update the data response? It's
Using a DataModel<MyObject> , I fill a data table according to this response Now
my jquery looks like this: $('#id_start_date_list').change( function get_time() { var value = $(this).attr('value'); alert(value);
I have a method in a controller that looks like this: [HttpPost] public void
I have a question about grabbing a certain value from the html response data
I almost dare to ask, but how can i get the response data of
Except YQL ,Is there any way to get ajax's response and data from other
I am getting response from web service in xml format and data are inside
I am getting data from server it gives in response a NSString which hase

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.