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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:42:59+00:00 2026-05-26T14:42:59+00:00

I have a PHP script that extract valid GeoJSON data from a database. Now

  • 0

I have a PHP script that extract valid GeoJSON data from a database. Now I would like to prepare a grid view of these data with jqgrid, but I can’t figure out the proper jsonReader for the javascript code.

This is my GeoJSON output:

{"type":"FeatureCollection",
"total":0, 
"page":1, 
"records":117, 
"features":[
     {"geometry":{"type":"Point","coordinates":[12.3,41.70052]},
      "type":"Feature",
      "properties":{
      "data":"2006-02-22",
      "specie":"S. coeruleoalba",
      "localita":"Ostia",
      "provincia":"Roma"
     },"id":0},
    {"geometry":{
     "type":"Point","coordinates":[15.26667,40.0502]},
     "type":"Feature",
     "properties":{
        "data":"2006-03-01",
        "specie":"S. coeruleoalba",
        "localita":"Golfo di Salerno",
        "provincia":"Salerno"
     },"id":1},
    {"geometry":{"type":"Point","coordinates":[14.88333,40.56692]},
     "type":"Feature",
     "properties":{
        "data":"2006-03-03",
        "specie":"S. coeruleoalba",
        "localita":"Battipaglia",
        "provincia":"Salerno"
    },"id":2}

]}

Using this reader my grid shows the right number of rows (117) and pages, but empty cells

jsonReader : { 
    root: "features", 
    page: "page", 
    total: "total", 
    records: "records", 
    repeatitems: false, 
    cell: "properties", 
    id: "id"
}

Can someone help me to write a working reader? Thanks in advance

  • 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-26T14:43:00+00:00Added an answer on May 26, 2026 at 2:43 pm

    Your main error is that you try to use cell: "properties", but cell property will be ignored in case of usage of repeatitems: false property.

    You should just use

    jsonReader: {
        root: "features",
        repeatitems: false
    }
    

    and then define jsonmap property for every column. For example you can use the following column definition:

    colModel: [
        {name: 'coordX', jsonmap:'geometry.coordinates.0', width: 75, sorttype: 'number',
            formatter: 'number', formatoptions: {decimalPlaces: 5}},
        {name: 'coordY', jsonmap:'geometry.coordinates.1', width: 75, sorttype: 'number',
            formatter: 'number', formatoptions: {decimalPlaces: 5}},
        {name: 'data', jsonmap:'properties.data', width: 90, align: 'center',
            sorttype: 'date', datefmt: 'm/d/Y',
            formatter: 'date', formatoptions: {newformat: 'm/d/Y'}},
        {name: 'specie', jsonmap:'properties.specie', width: 100},
        {name: 'localita', jsonmap:'properties.localita', width: 100},
        {name: 'provincia', jsonmap:'properties.provincia', width: 80}
    ]
    

    As the result you will be able to read your JSON data to the following grid:

    enter image description here

    (see the demo here). In your JSON data I changed only total value from 0 to 1 because it has no sense to have the total value less as the page value.

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

Sidebar

Related Questions

I'm writing a php script that will fetch data from a given URL and
I have PHP script that fetch messages from a mailbox. I use the imap_search
I have a PHP script that creates an entry into a mysql database. The
I have php script that creates a temporary watermark image for users that are
I have a PHP script that runs as a CGI program and the HTTP
I have a PHP script that needs to determine if it's been executed via
I have a PHP script that initialises an image gallery. It loops through all
I have a PHP script that can encode a PNG image to a Base64
I have a PHP script that sends critical e-mails. I know how to check
I have a PHP script that processes file uploads. The script tries to organise

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.