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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:02:11+00:00 2026-06-13T23:02:11+00:00

I’m trying to get dgrid to work with JsonRest. I’ve implemented a Perl based

  • 0

I’m trying to get dgrid to work with JsonRest. I’ve implemented a Perl based server-side component that issues the JSON data back. The response data looks like this:

{"id:": 00016, "num": 00016, "range": "15 - 63 (49)", "uid": "0", "ipaddress": "xx.xx.xx.xx", "hostname": "", "referer": "http:\/\/www.facebook.com\/l.php?u=http%3A%2F%2Fasisaid.com%2Fjournal%2Farticle%2F1604.html&h=8e20f", "useragent": "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8", "date":1281010282000}

Each of those hash “rows” is within an array. When the dgrid loads, it queries the server component without a Range header and the server component returns a default range of data. Then, dgrid queries again with “Range: items=0-24.” In response the server provides entries 1-25 in the format listed and with the response header “Content-Range: items 0-24/470.”

The problem emerges when the dgrid requests the next 40 items. It requests “Range: items=23-63” and the server successfully fulfills the request (I can see it using the WebKit developer tools, which show the data has been retrieved). However, when I scroll through the dgrid itself, I see rows 1-25 and then it jumps to row 40. If I keep scrolling, it continues to work towards loading all 470 entries, but the grid starts shifting around and the rows get dramatically out of order (for example, the grid starts with row 8 and row 1 shows up after row 75).

I thought it was perhaps because my JSON data didn’t include a definitely unique ID, so I added one (“id”) with the idProperty setting. No go. I also tried adding 10 rows of overlap to see if that would help, but that seemed to only make things worse.

Here’s my Dojo code:

require(["dojo/_base/declare", "dojo/store/JsonRest", "dojox/data/QueryReadStore", "dgrid/OnDemandGrid", "dgrid/Keyboard", "dgrid/Selection", "dojo/domReady!"], function(declare, JsonRest, QueryReadStore, OnDemandGrid, Keyboard, Selection){


 var store = new JsonRest({
   target: "perlsqllog2.pl",
   sortParam: "sort",
   idProperty: "id"
 });



var grid = new declare([OnDemandGrid, Keyboard, Selection])({
    store: store,
    query: {aid: "1604" },
    queryRowsOverlap: 10,
    columns: {
        num: "ID",
        range: "Debug",
        uid: "SAFARI User ID",
        ipaddress: "IP Address",
        date: "Date"
    },
}, "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-06-13T23:02:11+00:00Added an answer on June 13, 2026 at 11:02 pm

    As it turns out, I had a typo in my JSON data. I had it output “id:” in the JSON rather than “id” and that was preventing the grid from seeing it as the unique id. Apparently, dgrid does require a unique id to work and it seems to be working happily now that a unique ID is being provided.

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

Sidebar

Related Questions

I have a small JavaScript validation script that validates inputs based on Regex. I
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.