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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:54:41+00:00 2026-05-22T14:54:41+00:00

I am trying to manipulate the data fetched from the server in loadComplete event:

  • 0

I am trying to manipulate the data fetched from the server in loadComplete event:

loadComplete:function(data){
    alert("load completed");
    $.each (data,function(index,item){

    item["customerSite"]=item.header.customerName + ' / '+item.header.siteDescription;
    });
}

The newly added field is meant to be used as a column to be grouped by
However I keep getting this column as undefined as grouping header. I tried adding another field to the JSON object as a regular column, the column ends up to be empty. As I was debugging I noticed the grid is constructed before my breakpoint in the loadComplete stops.

My understanding of the loadComplete event is that it will fired as soon as the ajax call has success return. After I introduced gridComplete event to my code, I noticed gridComplete is invoked before loadComplete is invoked.

gridComplete: function(){ 
    alert("grid completed");
}

What I am doing wrong? I am using

            jsonReader: {
                repeatitems: false,
                id: "id",
                root: function (obj) { return obj; },
                page: function (obj) { return 1; },
                total: function (obj) { return 1; },
                records: function (obj) { return obj.length; }
            }

to process returned JSON string, but cannot imagine that might be the problem. Please help!

Base on Oleg’s comment, I will use custom formatter. However the result of the fomratter does not work for the group header, which this column is for. If I set groupColumnShow : [true], the column’s data is all correct, but still leaves the group header to be ‘undefined’

Following grid’s definition:

buildGrid:function(){
        var myGrid = jQuery("#serverList");

        myGrid.jqGrid({

        datatype: "json",
        url: "http://localhost:8080/cm.server/api/v1/agent/config.json?",
        jsonReader: {
            repeatitems: false,
            id: "id",
            root: function (obj) { return obj; },
            page: function (obj) { return 1; },
            total: function (obj) { return 1; },
            records: function (obj) { return obj.length; }
        },              
        colNames:['Customer/Site','Customer','Site','Server ID', 'Server Name', ,'id'],

        colModel :[ 
              {name:'customerSite',editable:false, formatter:that.buildCustmerSite},   
              {name:'header.customerName',hidden:true,editable:true,editrules:{edithidden:true},editoptions:{readonly:true,size:25},formoptions:{ rowpos:1,elmprefix:" "}},

              {name:'header.siteDescription', hidden:true, editable:true,editrules:{edithidden:true},editoptions:{readonly:true,size:25},formoptions:{ rowpos:2,elmprefix:" "}},         

              {name:'header.serverID', index:'header.serverID', width:200, align:'right',editable:true,editoptions:{readonly:true,size:25},formoptions:{ rowpos:3,elmprefix:" "}},

              {name:'header.serverName', index:'header.serverName', width:150, align:'right',editable:true,editoptions:{readonly:true,size:25},formoptions:{ rowpos:4,elmprefix:" "}},

              {name:'id', hidden:true},

            ],
            height: '500',
            width: '100%',
            rowNum:20,
            autowidth: true,
            pager: '#pager',
            sortname: 'serverID',
            sortorder: "desc",
            viewrecords: true,
            caption: 'Server Configurations',
            editurl:"/cm.server/api/v1/agent/config-grid",
            autoencode:true,
            ignoreCase:true,
            grouping:true,
            groupingView:{
                groupField:['customerSite'],
                groupColumnShow : [false]
            }
          });

      jQuery("#serverList").jqGrid('navGrid','#pager',
      {edit:true,add:false,del:false,search:true}, 
      {height:450,reloadAfterSubmit:true,  recreateForm:true,jqModal:true, closeOnEscape:true,  closeAfterEdit:true, bottominfo:"Fields marked with (*) are required"}, // edit options
            {} // search options
        );
      jQuery("#serverList").jqGrid('filterToolbar'); 
      return true;
    }

and following is the custom formatter:

buildCustmerSite:function(cellvalue,options,rowObject){
    var customerSite =rowObject.header['customerName'] + '/'+ rowObject.header["siteDescription"];
    return customerSite;
}
  • 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-22T14:54:42+00:00Added an answer on May 22, 2026 at 2:54 pm

    There are small differences between loadComplate and gridComplete, but both will be called after the grid contain is prepared. So you can’t just modify the data of the loadComplate to change the grid contain.

    You don’t posted the definition of your grid, so it is difficult to answer on your question exactly. What you probably want can be solved with respect of the custom formatter which you can define for the customerSite column. Inside of formatter function you have access to rowObject where you find source information to construct the customerName + ‘ / ‘ + siteDescription.

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

Sidebar

Related Questions

I'm trying to create a function that takes any table from my ADO.NET Data
I am trying to manipulate a conditional string outputted from SAS into the right
I am trying to make a program through which i want to manipulate data
I'm trying to port an iPhone application from using SQLite to Core Data. Is
I am trying to extract data from a xml file, get rid of the
I am trying to manipulate a string using Jython, I have included below an
I am currently trying to manipulate a unordered list with jQuery, essentially I have
It strikes me that Properties in C# should be use when trying to manipulate
I'm looking for a good python library to manipulate subversion repositories. I'm trying out
Trying to setup an SSH server on Windows Server 2003. What are some good

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.