Results 1 to 4 of 4

Thread: C# Data exchange using JSON

  1. #1

    Default C# Data exchange using JSON


    I'm using Ext JS 6.2 with a C# backend and trying to get data from my database in a grid. So far I got the entity framework setting up a database connection and using Linq I got my data. After parsing the result with javascriptserializer I got the json result to send to my ext frontend. It all works, the ajax call returns the data to the store, but the grid stays blank.

    my c# controller

    public ActionResult Index()
    var context = new Database_Entities();
    var table = (from Table in context.Table select Table).Take(1);
    return Json(new JavaScriptSerializer().Serialize(new { Table = table }), JsonRequestBehavior.AllowGet);

    the result


    the store

    Ext.define('', {
    extend: '',
    alias: 'store.table',
    model: 'ExtExampleApplication.model.Table',
    proxy: {
    type: 'ajax',
    url: '/Home',
    reader: { type: 'json', rootProperty: 'Table'}
    autoLoad: true

    It all looks pretty straight forward, but no result in my ext app. What am I missing here? Is my problem the escaped Json and do I need a transform in my store?

    Could somebody give me some pointers?

    Thanks in advance.

  2. #2
    Sencha User
    Join Date
    Feb 2013


    Any errors or warnings in the console? Your JSON data seems to be incomplete (no closing square and curly brace). Also this may just be how you represented it here, but your JSON is enclosed entirely within double quotes which is not valid.

  3. #3
    Sencha User
    Join Date
    Jun 2017
    United States


    Please check for the errors and warnings. You've missed bracket and curly braces... this is why, always consider using a library

  4. #4


    Found the solution, just added a transform to decode the data after getting the data by using the Ext.JSON library.

    proxy: {
    type: 'ajax',
    url: '/Home',
    reader: {
    type: 'json',
    rootProperty: '/',
    transform: function (data) {
    var extdata = Ext.JSON.decode(data);
    return extdata;

Similar Threads

  1. Replies: 1
    Last Post: 24 Sep 2012, 5:38 AM
  2. Replies: 3
    Last Post: 7 Sep 2012, 6:01 AM
  3. JSON datetime exchange problem
    By bryanevil in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 1 Jul 2010, 11:33 PM
  4. as data exchange object ?
    By Yuri in forum Community Discussion
    Replies: 0
    Last Post: 23 Oct 2008, 8:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts