The issue with Extjs store.proxy.extraParams being undefined appears to only occur in Internet Explorer

I currently have an ExtJs store set up with specific configurations.

var fieldsStore = new Ext.create('Ext.data.Store', {
model : 'FieldsModel',
proxy : {
    type : 'ajax',
    url : 'queryBuilder_getQueryDetails',
    extraParams : {
        queryID : queryID
    },
    reader : {
        type : 'json'
    }
},
listeners : {
    load : function(store, records, successful, operation, eOpts) {
        if (successful) {
            records.forEach(function(rec) {
                // default settings: if datatype is INTEGER - SUM
                if (rec.get('fieldType') == 'INTEGER') {
                    rec.set('fieldSettingKey', 'SUM');
                    rec.set('fieldSettingValue', 'Sum');
                } else {
                    // else select ROWHEADER by default
                    rec.set('fieldSettingKey', 'ROWHEADER');
                    rec.set('fieldSettingValue', 'Row Header');
                }
            });
            store.commitChanges();
        }
    }
}
});

After setting

fieldsStore.proxy.extraParams.queryID = arrQuery.queryId;
, I encounter an error specifically in Internet Explorer. This issue does not present itself in Chrome or Firefox, only in IE.

The error message indicates that fieldsStore.proxy.extraParams is either null or undefined.

Would anyone be able to provide insight into why this discrepancy occurs solely in IE?

Answer №1

Another option to consider is the following:

fieldsStore.getProxy().setExtraParam( 'queryID', arrQuery.queryId );

Answer №2

Discovered a different solution for this issue.

fieldsStore.proxy.extraParams = {queryID : arrQuery.queryId};

Answer №3

Give this a shot:

fieldsStore.getProxy().extraParams = arrQuery.queryId;

UPDATE:

If you want to simplify it, use the following code:

fieldsStore.getProxy().extraParams = {'queryID' : queryID}. This snippet will automatically set your extraParams configuration.

var fieldsStore = new Ext.create('Ext.data.Store', {
model : 'FieldsModel',
proxy : {
    type : 'ajax',
    url : 'queryBuilder_getQueryDetails',
    //-----------------------
    extraParams : {
        queryID : queryID
    },
    //-----------------------
    reader : {
        type : 'json'
    }
},
...
});

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

In JavaScript, creating a new array of objects by comparing two arrays of nested objects and selecting only the ones with different values

I've been struggling to make this work correctly. I have two arrays containing nested objects, arr1 and arr2. let arr1 =[{ id: 1, rideS: [ { id: 12, station: { id: 23, street: "A ...

Using Highstock for Dynamic Data Visualization in Web Applications

Looking to create a chart using data from a MySQL database that includes timestamps and temperature readings. The timestamp format is '2015-06-11 22:45:59' and the temperature is an integer value. Unsure if the conversion of the timestamp to Java ...

Differences between variable scope in Node.js and web browsers when running JavaScript code

When it comes to browser, different JavaScript files share one scope: a.js: var a=1; //by adding "var", we prevent it from becoming a global variable. b.js: console.log(a) //even though a=1, b.js can still access this variable! In Node.js: a.js .... b ...

Unable to retrieve the information through the use of the openWeatherMap API in JavaScript

Having trouble pinpointing the issue as nothing is being displayed in the selected div. $(document).ready(function(){ var lat, lng, data; // Retrieve current location if (navigator.geolocation) { navigator.geolocation.getCurrentPositio ...

Generate responsive elements using Bootstrap dynamically

I'm having success dynamically generating bootstrap elements in my project, except for creating a drop-down menu. ColdFusion is the language I am using to implement these div elements: <div class="panel panel-primary"><div class="panel-head ...

Failed network request in my ReactJS project under the "Auth/network-request-failed" error code

I'm currently working on a project focused on learning to use react-router-dom and firebase authentication for user sign-in and sign-up. However, I've run into an issue where I keep getting a FirebaseError: "Firebase: Error (auth/network-request- ...

Iterate over the object to verify if the field contains an empty array, then output null

Looking for help with handling empty arrays in an object: productDetails: { cislife: [], prime: [] } Is there a way to have null returned instead of an empty array if no values are available? For example, I'd like to determine if either t ...

Execute a function that handles errors

I have a specific element that I would like to display in the event of an error while executing a graphql query (using Apollo's onError): export const ErrorContainer: React.FunctionComponent = () => { console.log('running container') ...

Issue with Angular ngModel not syncing with variable changes

Currently using Angular 4 and Typescript, I have a table containing <select> elements in my template: <tr *ngFor="let task of tasksDetails"> <td>{{task.name}}</td> <td> <select class="form-control" [(ngMode ...

The transition between backgrounds is malfunctioning

I want to create a smooth transition effect for changing the background of an element within a setInterval function. Currently, the background changes immediately, but I would like it to transition over a period of time. var act = true; setInterval(func ...

Fill the table with information from a JSON file by selecting options from drop-down menus

I am currently working on a web application project that involves bus timetables. My goal is to display the timetable data in a table using dropdown menus populated with JSON information. While I believe I have tackled the JSON aspect correctly, I am facin ...

Underscore performs calculations and outputs a fresh object as a result

Here is an example of a time series: [ { "_id": { "action": "click", "date": "2015-02-02T00:00:00+01:00" }, "total": 5 }, { "_id": { "action": "hit", "date": "2015 ...

Encountering difficulty in retrieving data from an unidentified JSON array using Javascript

Exploring the realm of Javascript and JSON, I find myself faced with a challenge - accessing values in an unnamed JSON array. Unfortunately, as this is not my JSON file, renaming the array is out of the question. Here's a snippet of the JSON Code: [ ...

AngularJs promise is not resolved

Before processing any request, I always verify the user's authorization. Here is the factory code that handles this: (function() { angular.module('employeeApp').factory('authenticationFactory', authenticationFactory); fun ...

`Monitoring and adjusting page view during window resizing in a dynamic website`

Situation: Imagine we are reading content on a responsive page and decide to resize the browser window. As the window narrows, the content above extends down, making the entire page longer. This results in whatever content we were previously viewing bein ...

Utilize html5 to drag and drop numerous items effortlessly

Recently, I created a basic HTML5 drag and drop feature using JavaScript. However, I encountered an issue. function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("text", ev.target.id); } function drop(ev) { ...

Error message: A state has not been defined within the onload function

I'm facing an issue where I am attempting to assign a data URL of an image to a state in Vue.js, but it is not getting assigned properly. After converting a blob URL to a data URL, the state does not contain the correct data URL. While the imgSrc doe ...

What methods can Cypress use to validate content containing hyperlinks?

My current task is to develop an automation test that confirms the presence/display of content containing a hyperlink embedded within text. Please refer to the screenshot I have provided for better understanding, as it illustrates the specific content encl ...

Serving pages with Node JS and loading .js files on the client side

Here is a simple JS file that will be familiar to those who have worked with Socket.IO in NodeJS and Express: var express = require('express'), app = express(), server = require('http').createServer(app), io = require(&apos ...

Blend multiple images using Angular

Is there a way to combine multiple images in Angular? I came across some HTML5 code that seemed like it could do the trick, but unfortunately, I couldn't make it work. <canvas id="canvas"></canvas> <script type="text/javascript"> ...