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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:43:44+00:00 2026-06-02T06:43:44+00:00

My problem is the following : – i’m using jqgrid to display local data

  • 0

My problem is the following :
– i’m using jqgrid to display local data
– this data is parsed from a webservice in several parts
– i get an array of object as data (can be changed)
– i try to add the new data parts by parts with addJSONData, no luck
– i also tried with setting the jqGrid parameter “data” to a merged array of the data parts, no luck

With some trys i get empty rows.
Using a formatter the rowObject is ok, but the cellValue is empty (undefined).
It seems that the colModel and the data structure are not “compatible”.

I want to be able to add data to the grid in several parts.
The rows should be displayed sorted.

Here are the parameters :

{  
caption: 'Villes',  
data: [],  
datatype: 'local',  
colNames: ['Actions', 'Distance', 'Coordonnées', 'Nom', 'Joueur', 'Puissance', 'Alliance', 'Diplomatie', 'Brumes', 'Status'],  
colModel: [  
    {name: 'actions', sortable: false, search: false, formatter: Shared.gridRowActions, width: 50},  
    {name: 'range', index: 'range', width: 60},  
    {name: 'coords', index: 'gps', sortable: false, search: false, formatter: function( cellValue, options, rowObject ){ return Shared.mapLink(cellValue); }, width: 90},  
    {name: 'city', index: 'city'},  
    {name: 'player', index: 'player'},  
    {name: 'might', index: 'might', align: 'right', defval: 0, formatter: function( cellValue, options, rowObject ){ return Shared.format(cellValue); }, width: 70},  
    {name: 'guild', index: 'guild'},  
    {name: 'diplomacy', index: 'diplomacy', formatter: function( cellValue, options, rowObject ){ return Shared.getDiplomacy(cellValue); }, width: 70},  
    {name: 'mist', index: 'mist', align: 'center', formatter: function( cellValue, options, rowObject ){ return cellValue === 1 ? 'Oui' : ''; }, width: 55},  
    {name: 'user', index: 'user', formatter: function( cellValue, options, rowObject ){ return Shared.userStatusLink(cellValue); }}  
],  
pager: '#pager-cities',  
loadui: 'disable',  
rowNum: 20,  
rowList: [20, 50, 100],  
sortname: 'range',  
sortorder: 'asc',  
altRows: true,  
autowidth: true,  
viewrecords: true,  
gridview: true,  
multiselect: true,  
multiboxonly: true,  
multikey: 'shiftKey'  
}

And then the code for adding data to the grid.

var merged = [];
var $grid = $('#grid);
...
merged = merged.concat(cities);
$grid.jqGrid('setGridParam', {data: merged}).trigger('reloadGrid');

Also tried:

$grid[0].addJSONData( {page: 0, total: 0, records: cities.length, rows: cities} );

The data array is for exemple:

[
    {"id":338591,"cell":[2,"338,591","140","15545536","Lord Patrice02200","","0","Patrice02200",0]},
    {"id":339591,"cell":[2.24,"339,591","50","16300072","Lord mercedes9pd7e","","0","mercedes9pd7e",0]},
    {"id":341591,"cell":[3.61,"341,591","727714","16330552","Lord Torkan","","0","Rizane",0]},
    {"id":341592,"cell":[4.24,"341,592","490","10929616","Lord pulpfiction","","0","pietra",0]}
]

The only things i really need is the ability to load the data by parts and that the grid data are displayed sorted after each data add.
A working pager will be a bonus.

  • 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-02T06:43:46+00:00Added an answer on June 2, 2026 at 6:43 am

    Your problem is that you have chosen very exotic format of data. The default format representation of the local data is array of objects with named properties. Additional property in the array items are expected id. You use another format so you have to add localReader parameter which describes the format of data

    The demo

    enter image description here

    uses the same grid which you posted. I just added

    localReader: {repeatitems: true}
    

    and removed all formatters which code you not posted. The best way to fill the grid is to use data option with the input data. I added height: "auto" only for better look of the grid. So you will see

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

Sidebar

Related Questions

I have following problem: My webservice application returns xml data in following order: <my_claims>
I have a problem following from my previous problem . I also have the
Following problem: Website build with PHP/HTML working We want to change this site to
The problem is following: Some client tries to access an SOAP webservce Webservice implementation
The following problem has been puzzling me for a couple of days (nb: this
I have following problem: I want to count data in one table, count data
I have following problem: my Query with joins contains all the nesessary data but
following problem: I created a NSXMLParser subclass to get Xbox Live profile data, the
I encountered following problem: I write program in c++ using VS2010. Debug build works
I have following problem Bundle bundle = new Bundle(); bundle.putString(url, someUrl); This works fine.

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.