The grid fails to apply remote filtering values when an additional Nested ajax call is incorporated alongside the current HttpProxy configuration

Whenever I click for filter/sort for remote filtering, Forms.asp triggers using a proxy and automatically reloads. Previously, when I used the script below to reload the ExtJS grid with Forms.asp returning new XML with filtered grid data, everything worked smoothly.

var gridStore = new Ext.data.Store({
            gridId  :'d_grid',
            reader: new Ext.data.XmlReader({ record: etc }, etc etc),
            proxy: new Ext.data.HttpProxy({ url: "Forms.asp?", 
            timeout: 120000 }),
            baseParams:{
                XML:$$("XML").value,                                
                some more params                
            },          
            data: doc,
            remoteSort: true});

However, when I tried to modify it with a WCF call like:

var gridStore = new Ext.data.Store({
                gridId  :'d_grid',
                reader: new Ext.data.XmlReader({ record: etc }, etc etc),
                proxy: new Ext.data.HttpProxy({ url: "Forms.asp?", 
                timeout: 120000  ,

            success: function (response) {
                FilterXml = response.responseText;

                created new XmlDoc= with somechanges(FilterXml)

                Ext.Ajax.request({
                             method: 'POST',
                             url:'/mayo/Service.svc/GetnewXML',
                             params: {'strIPXML': XmlDoc.xml}});
            }}),
                baseParams:{
                    XML:$$("XML").value,                                
                    some more params                
                },          
                data: doc,
                remoteSort: true});

Here, I am capturing the response from the earlier ASP and further modifying it by sending it to a web service. With the newly added AJAX, the same formatted XML is returned as in the previous case (confirmed using success: function{ alert etc}).

However, "The new XML is not feeding to the grid as it was in the previous case." No errors are thrown. I am using ExtJS 3.4. Please help.

Answer №1

After extensive research and exploration, I finally found a solution to my problem. Initially, I mistakenly believed that using store.load with HttpProxy would help in reloading the data through AJAX. However, after delving deeper into the issue, I realized that this approach might not work as expected for AJAX. Therefore, I made the necessary adjustments and switched to using store.loadData, which successfully resolved the issue.

var gridStore = new Ext.data.Store({
                gridId  :'d_grid',
                reader: new Ext.data.XmlReader({ record: etc }, etc etc),
                proxy: new Ext.data.HttpProxy({ url: "Forms.asp?", 
                timeout: 120000  ,

            success: function (response) {
                FilterXml = response.responseText;

                create a new XmlDoc with modifications to FilterXml

                Ext.Ajax.request({
                             method: 'POST',
                             url:'/mayo/Service.svc/GetnewXML',
                             params: {'strIPXML': XmlDoc.xml}

                             success: function (response) {
                                                FormXML = PC.getXmlStr(response.responseXML);
                                                doc = OrchGenericObj.GetXMLObj(FormXML, 0);
                                                Ext.getCmp('dashboard_gd').store.loadData(doc);
                            }    });
            }}),
                baseParams:{
                    XML:$$("XML").value,                                
                    additional parameters                
                },          
                data: doc,
                remoteSort: true});

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

403 error: jQuery Ajax POST denied

I'm encountering an issue while trying to execute a simple ajax post using jQuery: $.ajax({ type: 'POST', url: "ucUploadDownloadCommand.ascx/UploadXLSFile", data: "{}", dataType: 'json', contentType: "application/json; c ...

React JS BlueprintJS Date Range Picker not functioning as expected

I am struggling to implement a DateRangePicker using BlueprintJS on my component, following the instructions in the documentation. I also want to include a RangePicker similar to the one shown in this screenshot. I have successfully installed all the nece ...

"After executing a loop in JavaScript using jquery.ajax, the success function does not perform

Having trouble passing values from a PHP file to another function in Javascript. Even after a successful FOR LOOP, nothing seems to work within the SUCCESS block. Any suggestions? url1 = 'http://localhost:81/Dashboard/admin/inc/dashboard.php'; $ ...

Styling with the method in React is a beneficial practice

I am working on a simple React app that includes some components requiring dynamic styling. I am currently using a method to achieve this, but I am wondering if there are other recommended ways to handle dynamic styling in React. Everything seems to be wor ...

Submitting user input to PHP with AJAX to enable autocomplete functionality for various query scenarios

Currently, I am utilizing jQuery autocomplete feature on an input form labeled 'city'. However, my objective is to have the query in my 'autocity.php' file suggest only cities within a pre-selected country. For example, WHERE City LIKE ...

Modifying dynamic input fields based on the selected input field type

Seeking advice on a challenge I'm facing while testing a website. My task is to mask input fields in screenshots after executing tests because we share data with other teams. I've tried using JS before the script by changing the input type to &ap ...

Percy snap shot test cannot be executed in Testcafe due to the error message: npm ERR! The script 'test:percy' is

For my initial test with percy snapshot, I used the command below: npm run test:percy Unfortunately, an error message appeared when running the command: xxx.xxx@LPG002572 TC-Visual % npm run test:percy npm ERR! missing script: test:percy npm ERR! A com ...

Error message in ASP.Net MVC when using JQuery: Receiving an undefined return

How can I modify my .Net MVC controller to successfully return a value using an SQL query that involves an Email field? Currently, the email is being read by the query but the resulting value is not being transferred over to the View with Json. Here is th ...

Implementing a dynamic loading strategy for Google reCAPTCHA based on language selection

I have a unique application that requires the selection of one language out of four options (English, French, Dutch, español) in a form. Below the language selection, the Google reCaptcha is displayed. I am looking to dynamically load the reCaptcha scrip ...

Nest.js: initializing properties from a superclass in a controller

I have a question about unit testing controllers in the Nest.js framework. My issue is that the property from a superclass is not initialized in the controller class when creating a test module. Here is an example of the code I am referring to: export cl ...

Guide to activating the isActive status on a live link within a map iteration utilizing the NEXTUI navigation bar

Check out the new NEXTUI navbar I'm using: I am having trouble setting the isActive property on the active link in my NavBar component in Next.js. I couldn't find much help on Google, so I'm hoping someone here has experience with this or k ...

The challenges of using Three.JS and Blazor: Solving Black Canvas and Console Errors in WebGL

Exploring the world of Blazor web assembly, I embarked on a project to harness the power of JSInterop with Three.JS to draw lines. Following the guidelines provided in their tutorials available Here, I diligently installed Three.JS using npm and webpack, w ...

The C# [WebMethod] will not trigger if the Content-Type "application/Json" is missing

After creating a C# WebMethod, I was able to successfully call it using Ajax, angular, and Postman when adding the header Content-Type: 'application/Json'. Here is an example of the HTTP request that worked: $http({ url: 'default.aspx/G ...

Place a request for the Material UI switch on the platform

I'm currently in the process of constructing a switch that gets its checked value from the data retrieved from the backend. When a user toggles it, a PUT request is sent to the backend for updating the choice. Although I've made progress on it, ...

What is the way to create the appearance of a hand or arrow hovering over my "X" while I am closing out my Div using jQuery?

Hey there, I've got a handle on closing the div using a "p" tag in jQuery. The code snippet for that is provided below. However, I'm looking to change the cursor over the "X" to an arrow or hand symbol, similar to what you'd see with an "a" ...

How can I relocate an object to a different position within THREE.JS?

I'm trying to figure out how to move one object to the position of another object. I found some suggestions online to use the TWEEN library, but I'm having trouble integrating it into my code. Any help would be greatly appreciated :) <scrip ...

Steps for selectively extracting objects from an array containing nested objectsNeed a way to isolate specific objects

Currently, I am working on a project in JavaScript and have created an array called folders that holds multiple objects: folders = [folder1, folder2, folder3...] Each object within the array has various properties, one of which is docs that is an array o ...

Incorporating Chartist.JS with Jade-syntax pages

Hello everyone, I need some assistance with integrating Chartist.JS into a node Template to display a basic bar graph. The script doesn't seem to be working properly and I'm unsure of what's causing the issue. Can anyone please take a look a ...

Is it possible for URLSearchParams to retrieve parameters in a case-insensitive manner

Is it possible for URLSearchParams to search a parameter without being case-sensitive? For instance, if the query is ?someParam=paramValue, and I use URLSearchParams.get("someparam"), will it return paramValue? ...

Having trouble launching the freshly developed Angular app

I'm encountering an issue with my newly created app - I can't seem to launch it. Error: The loader “C:/C#/Angular/my-app/src/app/app.component.css” is not providing a string as expected. https://i.sstatic.net/6Xjwd.png https://i.sstatic.ne ...