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

  • Home
  • SEARCH
  • 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 8616453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:37:24+00:00 2026-06-12T05:37:24+00:00

I am trying to create a gridview in extjs using json. For some reason

  • 0

I am trying to create a gridview in extjs using json. For some reason my gridview does not show any data. I tried to debug it with firebug. I can see the results in “Response” section.
This is what I have in “Reponse”.

{“ContentEncoding”:null,”ContentType”:null,”Data”:”{\r\n \”myTable\”: [\r\n {\r\n \”Q1\”: \”1\”,\r\n \”Q2\”: \”1\”,\r\n \”Q3\”: \”1\”,\r\n \”Q4\”: \”1\”,\r\n \”Improvements\”: \”\”,\r\n \”Comments\”: \”1\”\r\n },\r\n {\r\n \”Q1\”: \”1\”,\r\n \”Q2\”: \”2\”,\r\n \”Q3\”: \”3\”,\r\n \”Q4\”: \”4\”,\r\n \”Improvements\”: \”Iphone5\”,\r\n \”Comments\”: \”Iphone14\”\r\n },\r\n {\r\n \”Q1\”: \”1\”,\r\n \”Q2\”: \”1\”,\r\n \”Q3\”: \”3\”,\r\n \”Q4\”: \”3\”,\r\n \”Improvements\”: \”This is Comment1-3\”,\r\n \”Comments\”: \”This is Comment2-3\”\r\n }\r\n ]\r\n}”,”JsonRequestBehavior”:0}

Update
Actually I see this in Json now, but my gridview is still empty
Please click here to see my JSON

/GridViewApp.js

Ext.define('GridViewApp.view.GridViewApp', {
alias: 'widget.gridviewapp',
width: 800,
title: 'My Grid Panel',
grid: null,
store: null,
layout: {
    type: 'anchor'
},
constructor: function () {

    this.callParent(arguments);

    var store = Ext.create('Ext.data.Store', {

        storeId: 'myData',
        scope: this,
        fields: [
        { name: 'Q1', type: 'int' },
        { name: 'Q2', type: 'int' },
        { name: 'Q3', type: 'int' },
        { name: 'Q4', type: 'int' },
        { name: 'Q5', type: 'int' },
        { name: 'Improvements', type: 'string' },
        { name: 'Comments', type: 'string' }
        ],

        sorters: [
            {
                //property: 'myData',
                direct: 'ASC'
            }
         ],

        proxy: {
            type: 'ajax',
            scope: this,
            url: 'GridView/writeRecord',
            reader: {
                type: 'json',
                root: 'myTable',
                idProperty: 'ID'

                }
        } 
    });

    store.load();   
    this.grid = Ext.create('Ext.grid.Panel', {
        title: 'GridView App',
        store: this.store,
        columns: [
            {header: 'Q1', width: 100,
        sortable: true, dataIndex: 'Q1'
                    },
        { header: 'Q2', width: 100,
            sortable: true, dataIndex: 'Q2'
        },
        { header: 'Q3', width: 100,
            sortable: true, dataIndex: 'Q3'
        },
                    { header: 'Q4', width: 100,
                        sortable: true, dataIndex: 'Q4'
                    },
                    { header: 'Improvements', width: 200,
                        sortable: true, dataIndex: 'Improvements'
                    },
                    { header: 'Comments', width: 200,
                        sortable: true, dataIndex: 'Comments'
                    }
    ],
        stripeRows: true,
        width: 800,
        renderTo: Ext.getBody()
    });
    this.add(this.grid);
}
});

and /GridViewController.cs

namespace GridViewApp.Controllers
{
public class GridViewController : Controller
{

    public ActionResult Index()
    {
        return View();
    }


    public JsonResult writeRecord()
    {

        SqlConnection conn = DBTools.GetDBConnection("ApplicationServices2");


        string sqlquery = "SELECT Q1, Q2, Q3, Q4, Improvements, Comments FROM myTable";
        SqlDataAdapter cmd = new SqlDataAdapter(sqlquery, conn);

        DataSet myData = new DataSet();
        cmd.Fill(myData, "myTable");

        conn.Open();

        conn.Close();


        string myData1 = JsonConvert.SerializeObject(myData, Formatting.Indented,
                        new JsonSerializerSettings
                        {
                            ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                        });

        return Json(new { data = myData1 }, JsonRequestBehavior.AllowGet);
    } 

}
}

Any kind of input will be a big help… Thank you

  • 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-12T05:37:26+00:00Added an answer on June 12, 2026 at 5:37 am

    It’s pretty logic that it returns a string.

    You serialize with json.net into a string. Then you serialize that string with Json(). You should only use the json.net serialization.

    public string writeRecord()
    {
    
        SqlConnection conn = DBTools.GetDBConnection("ApplicationServices2");
    
    
        string sqlquery = "SELECT Q1, Q2, Q3, Q4, Improvements, Comments FROM myTable";
        SqlDataAdapter cmd = new SqlDataAdapter(sqlquery, conn);
    
        DataSet myData = new DataSet();
        cmd.Fill(myData, "myTable");
    
        conn.Open();
    
        conn.Close();
    
    
        return myData1 = JsonConvert.SerializeObject(myData, Formatting.Indented,
                        new JsonSerializerSettings
                        {
                            ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                        });
    
    } 
    
    • 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 simple example of an editable gridview, and for some
Hi everyone I'm trying to display some images using a GridView. However I'm getting
I am trying to create a gridview and load some images from URLs to
In a GridView, I'm trying to show either one column or an other using
I am trying to display a gridview in extjs. That data is collected from
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM
Trying to create a macro which can be used for print debug messages when
I am using a Telerik GridView , and having an issue trying to sort

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.