There seems to be an issue with loading data for the grid from the JSON

I need some help with creating a fiddle that loads data from a json file. I'm not sure why the data is not loading properly.

You can view my fiddle here: Fiddle

This is my code for the data store:

Ext.create('Ext.data.Store', {
    storeId: 'Ajax_Store',
    proxy: {
        type: 'ajax',
        url : 'emp.json',
        reader: {
            type: 'json',
            rootProperty:"Emp"
        }
    },
    autoLoad : true,
    fields: ['E_ID','E_FName','E_LName','E_Place']
});

Answer №1

The reason for this issue is that you have activated the "dynamic data" feature without returning any value from the function:

If you turn off dynamic data, you will notice that JSON only uses double quotes. The corrected JSON data is as follows:

{"Emp" : [{
   "E_ID": 125,
   "E_FName": "Lisa",
   "E_LName":"King",
   "E_Place": "Rome"
  },
  {
   "E_ID": 126,
   "E_FName": "John",
   "E_LName":"Lever",
   "E_Place": "Rome"
  },
  {
   "E_ID": 127,
   "E_FName": "Lee",
   "E_LName":"Dev",
   "E_Place": "Rome"
  }
 ]}

This JSON will be displayed correctly if the "dynamic data" option is turned off.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is NoSQL supported by the MySQL Community Edition?

I have decided to dive into learning and developing a Node.js application with SQL. I am aware that the MySQL Enterprise Edition offers support for NoSQL, but I'm curious if the community edition also supports NoSQL or if I need to invest in the enter ...

Troubleshooting the lack of deep linking functionality in an AngularJS web application when using Node Express server

(Update: The problem has been successfully solved. Check the end of the question for details) I am currently facing a seemingly trivial issue that is causing me a great deal of frustration as I struggle to find a solution: After scaffolding an Angular ap ...

Navigating with React Router using URL parameters

After implementing react router with a route path taskSupport/:advertiserId that includes parameters, I encountered an issue when trying to access the link http://localhost:8080/taskSupport/advertiserId. My browser kept returning 404 (Not found) errors for ...

Retrieving a specific data point from the web address

What is the most efficient way to retrieve values from the window.location.href? For instance, consider this sample URL: http://localhost:3000/brand/1/brandCategory/3. The structure of the route remains consistent, with only the numbers varying based on u ...

Using an anonymous function in Javascript to change the background color of a div on mouse-over directly from the HTML code

I came across this code snippet in the provided link and as a beginner in JavaScript, I am unsure how to call the JavaScript function from the HTML code. Due to them being anonymous functions, I am struggling to invoke them. Can someone guide me on how to ...

The art of rotating PDF files and various image formats

Looking for a way to rotate PDF and image files displayed on an HTML page using jQuery. I attempted: adding a CSS class - without success. Here is an example code snippet: .rotate90 { webkit-transform: rotate(90deg); moz-transform: rotate(90de ...

Storing a jquery ajax response for faster retrieval in javascript/browser

Is there a way to implement caching for ajax responses in JavaScript or the browser? According to the jquery.ajax documentation: The default behavior is that requests are always issued, but the browser may serve results from its cache. To prevent the ...

What are the steps to execute a filter operation on a table by utilizing two select box values with jQuery?

I have a challenge with two dropdown menus. One contains names and the other subjects, along with a table displaying information in three columns: name, subject, and marks. I would like to implement a filter based on the selections in these two dropdowns. ...

Monitor the console log in the Android Browser for any potential issues

My website runs smoothly on all browsers, except for the Android browser when using JavaScript. I am aware that I can activate JavaScript debugging with about:debug, but I am unsure of where to find the console log/errors. How can I locate and check my b ...

Using the length of an array as an iterator within a nested ngFor loop in Angular 9

I am looping through an array of objects where each object contains another array of objects with attributes like "name" and "id". The length of this array of objects (noticias) varies. I am struggling to display these values and have only managed to acce ...

Tips for integrating a logo into router view animations

How can I incorporate a logo into the white fade-in screen that appears when navigating between subpages using <router-view> within App.vue? Here is a simplified version of my App.vue code: <template> <div id="app"> <div ...

Merge the xAxis functionality with Highcharts

My issue involves a chart generated by highcharts.js. The problem arises with a line chart consisting of 5 values (5 points), each displayed on the xAxis as follows: from value 1 to value 2: 0, 0.25, 0.5, 0.75, 1. I am looking to modify this display and re ...

Unable to trigger JQuery .blur event

I am currently working on implementing server-side validation for an input field that needs to be validated when it loses focus. However, I'm running into an issue where the alert is not triggered when the input field loses focus. Here's a snipp ...

How to filter out content not contained within a specific form tag using Javascript

One feature of my webpage displays restaurant reviews, each with a like button. However, the issue arises when submitting the like form: everything within and outside of a particular form tag gets sent to the back-end. This makes it challenging to determin ...

Webpack is having trouble locating images within Nextjs

When I import static images with no issues using npm run dev, everything runs smoothly. However, when attempting to utilize npm run build or next build, it fails and prevents deployment to Vercel. next info Operating System: Platform: win32 ...

Error in NodeJs: ReferenceError - the variable I created is not defined

Encountering an issue while attempting to use a module in my router file. I have successfully required it, but now I am seeing the following error message: ReferenceError: USERS is not defined at c:\work\nodejs\router\main.js:32 ...

Difficulty unraveling JSON using Codable. Error message indicating keyNotFound

I'm facing an issue when it comes to decoding JSON. I've been attempting to decode my JSON using let temp = try JSONDecoder().decode([LastTemperatureResponse].self, from: data). The Codable structs I'm working with are as follows: struct ...

Tips for dynamically populating a RecyclerView with items

Is it possible to dynamically add items to a RecyclerView? I have created a RecyclerView based on the current JSON response, but I want to make it dynamic because there may be many items to show in the future. The item size is not fixed. How can I achieve ...

Troubleshooting: Vue JS failing to recognize new objects and properties in HTML

Within my Vue instance, I have a method named `loadPlannedAlerts` that performs an AJAX call to retrieve JSON data. This method is called during the `mounted` lifecycle hook of my Vue JS instance. The retrieved JSON object consists of key-value pairs struc ...

When a new VueJS project is created, it failed to automatically install the necessary basic HTML files and folders

Hey there, I am completely new to Vue.js. Just recently, I installed the Vue.js/CLI and created a brand new project using vue create test. This prompted me to choose from three options: > Default ([Vue 2] babel, eslint) Default (Vue 3 Preview) ([Vue 3 ...