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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:40:23+00:00 2026-05-24T08:40:23+00:00

I have been trying to implement DoJo Enhanced Grid with Json and I have

  • 0

I have been trying to implement DoJo Enhanced Grid with Json and I have not been successful thus far.

This is what I have done so far;

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <div xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" xmlns:spring="http://www.springframework.org/tags" version="2.0">
<jsp:output omit-xml-declaration="yes"/>
<spring:url value="/students/listdata" var="mydatasource"/>

<script type="text/javascript">
    dojo.require("dojo.parser");
    dojo.require("dojox.grid.EnhancedGrid");
    dojo.require("dojox.grid.enhanced.plugins.IndirectSelection");
    dojo.require("dijit.form.Button");
    dojo.require("dojo.data.ItemFileReadStore");
    dojo.addOnLoad(function() {
        dojo.parser.parse();
        loadGrid(dataGrid);
    });

    function loadGrid(dataGrid) {
        dojo.xhrGet({
            url: "${mydatasource}",
            load: function(data, ioArgs) {
                dataGrid.setStore(
                        new dojo.data.ItemFileReadStore(
                            {data: {items : data}})
                );
            },
            error: function(error) {
                console.log("loading of grid data failed. Exception...", error);
            }
        });
    }
</script>
<util:panel id="titlePane" title="Course List">
    <div id="addButton" dojoType="dijit.form.Button">
        Add
    </div>
    <div id="deleteButton" dojoType="dijit.form.Button">
        Delete
    </div>

    <div id="grid" jsId="dataGrid" dojoType="dojox.grid.EnhancedGrid"
        structure ="[
                        { field: 'id', name: 'ID', width: '55px' },
                        { field: 'firstName', name: 'First Name', width: '230px' },
                        { field: 'lastName', name: 'Last Name', width: '50px' },
                        { field: 'gender', name: 'Gender', width: '145px'}
                    ]"
        autoWidth="true"
        autoHeight="true"
        plugins="{indirectSelection: true}"
        selectionMode="single">
    </div>
</util:panel>

As you can see, I am getting the Json String via the AJAX call by DOJO. The grid is generating however, it is not being populated with data. Only two check boxes comes up in the grid…

Is there anything that I’m doing wrongly?

  • 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-24T08:40:24+00:00Added an answer on May 24, 2026 at 8:40 am

    found out the problem to the grid not loading data.

    Actually I needed to handle the data as a Json String.

    below is copy of the code that works:

    <script type="text/javascript">
        dojo.require("dojo.parser");
        dojo.require("dojox.grid.EnhancedGrid");
        dojo.require("dojox.grid.enhanced.plugins.IndirectSelection");
        dojo.require("dijit.form.Button");
        dojo.require("dojo.data.ItemFileReadStore");
        dojo.addOnLoad(function() {
            dojo.parser.parse();
            loadGrid(dataGrid);
        });
    
        function loadGrid(dataGrid) {
            dojo.xhrGet({
                url: "${mydatasource}",
                handleAs: "json", 
                load: function(data, ioArgs) {
                    dataGrid.setStore(
                            new dojo.data.ItemFileReadStore(
                                {data: {items : data}})
                    );
                },
                error: function(error) {
                    console.log("loading of grid data failed. Exception...", error);
                }
            });
        }         
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying this for so long, but was not able to implement
I have been trying to implement this code , where i capture a image
I have been trying to solve this for 2 weeks and I have not
I have been trying to add/implement this example to my existing Split View app
I have this hashCode function that I have been trying to implement with Eclipse
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
I've been trying to implement unit testing and currently have some code that does
I have been trying to get around this error for a day now and
I have been trying to implement a CheckBox Node Tree, where the parent nodes
I have been trying to implement hash-tables using uthash.h, following the (excellent) documentation I

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.