Enhance pagination and column filtering in JQGrid without relying on local data (loadonce = false)

I'm currently facing an issue with my web application development. I am utilizing Laravel 5.8 for the backend and JQGrid version 4.6.0 to create grids.

One of the grids I have is constructed with a dynamic URL that fetches JSON data from the server based on filter parameters provided. As a result, the grid has the loadonce attribute set to false.

The problem I am encountering is that the pagination and column filtering are not functioning properly at the moment. It seems like I might need to create a server-side solution for each pagination and filtering feature. However, I am uncertain because I haven't come across a concrete example on how to tackle this.

Upon observing the "Network Tab" in Google Developer Tools, I noticed that a particular URL is being called when trying to sort by column, such as:

http://localhost/projetMecenat/public/listes/cerfa/json/null?_search=false&nd=1621430296935&rows=5&page=1&sidx=NUM_CERFA&sord=asc
, but I am unsure how to utilize this information.

If anyone has experience dealing with a similar scenario, I would greatly appreciate your assistance.

Thank you in advance :)

Answer №1

Many resources and tutorials are available to help you understand this concept. It is recommended that you search for and review them. I suggest starting with the official documentation.

You can also view a MySQL example demonstrating paging and sorting here

Although the example uses xml data, it can be adapted for JSON as well.

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

Application route is failing to direct to the HTML page

On my MEAN stack website, I am trying to make the browser navigate to a file named 'findCable.html' but it keeps directing to 'singleCable.html'. I have double-checked the angular routing file and backend routes, but can't see ...

Cease the continuous scrolling of the display element now

I'm having trouble with my progressbar animation when scrolling. It seems to run multiple times instead of just once. I apologize if there's an error in my code. Could someone please assist me? This is the code I am using: <div class="demo- ...

Error: Trying to call an undefined function

Having trouble with an error on this line: $("#register-form").validate. Can anyone offer assistance? Furthermore, if I write this script, how should I incorporate it into the form? Will it function without being called? <script type="text/javascript ...

Ways to retrieve a value from a JavaScript function without using the return statement

I wrote a Javascript method as follows: function ServerSideDatasource(server) { return { getRows: function (params) { var response = server.getData(params.request).then((res) => { var result = { success: true, ...

Tips for utilizing the /foo-:bar pathway in Nuxt.js?

I am trying to utilize the router /foo-:bar in Nuxt. Do you have any suggestions on how I could make this work? I attempted using pages/foo-_bar.vue but it did not yield the desired results. ...

Avoid positioning issues when dropping a DIV onto the Canvas

Utilizing the JavaScript code below allows me to drag a DIV onto a canvas. I am currently loading a multi-page PDF, which consists of image files, in a pop-up window and positioning canvas layers over them. In these canvas layers, shapes are then loaded at ...

Benefits of Utilizing Object.create

Unlike the referenced question, this code snippet is sourced from the book "JavaScript: The Definitive Guide". It introduces an inherit method that applies Object.create if available, but falls back to traditional JavaScript inheritance when it's not. ...

Error message: Cannot generate Three.js mesh due to undefined buffer attribute in BufferAttribute.copyVector3sArray vector

During runtime, I am constructing the mesh of a sphere for later use in supershape generation, which is why I am not using SphereGeometry. The current vector placements appear to be functioning correctly, as confirmed by placing spheres at the correspondin ...

"Curious as to why no response from socket.io integration with react.js

Backend set up: const express = require("express"); const http = require("http"); const socketIo = require("socket.io"); const axios = require("axios"); const port = process.env.PORT || 4001; const index = require("./routes/index"); const app = express(); ...

Changing the filepath for the build script in the package.json file for a NextJS project when deploying to Heroku

My project is currently structured as Root: Folder 1/ Folder 2/ Folder 3/ .. Frontend/ The front end folder contains my Nextjs project, package.json file, and everything else. However, Heroku requires the content in the Frontend/ folder to be in the root ...

Focus on all of the individual items except for the one that was just selected

Within the function thirdNavFunction, I am seeking a way to specifically target all instances of the .third-nav classes, excluding the one that has been clicked on. This must be accomplished without utilizing jQuery. How can I achieve this? var thirdNav = ...

Align the text on the same horizontal line

I have been struggling with this issue for hours. Here is my Header.js <div className="navbar-inner"> <h2>Text1</h2> <h3>Text2</h3> </div> This is the content of my Header.css: .navbar-inner { ...

sending an array from one CodeIgniter view to another view via Ajax

In the following code segments of my application, myArray is an array where each element contains a few objects that I need to use in a second view. When I use alert(myJSON);, I am able to see the array in the alert window. However, when the view loads, i ...

Is there a way I can sort an array by checking if a key exists in an object?

I am currently working with code that filters data based on specific keys - in this case, "bounced" or "opened". Filtering for "bounced" items is working perfectly, but I am facing an issue with "opened" items. The key "opened" only exists if a message has ...

"Step-by-step guide on setting up Angularjs ng-model in a Rails environment

Question regarding the utilization of two-way binding in AngularJS and Rails ERB files. Let's say the input value in my .erb file has an initial value like this: example.erb <input type="text" value=" <%= @item.title %> " ng-model ="item.t ...

Tips for adjusting the button color in Material UI by utilizing the ":active" pseudo-class

In the project I am currently working on, I am incorporating Material UI. One of the tasks I need to complete is changing the active state of a button. I have implemented both hover and active states from Material UI in my code: const useStyles = makeStyle ...

The error message states that the property "user" is not found in the type "Session & Partial<SessionData>"

I recently had a javascript code that I'm now attempting to convert into typescript route.get('/order', async(req,res) => { var sessionData = req.session; if(typeof sessionData.user === 'undefined') { ...

utilizing the data provided by a user in the "prompt" window within my HTML code

Looking to utilize user input from the prompt window. This is my custom JavaScript form: var answer; function load() { answer=prompt("what is your name?", "Write your name here"); return answer; } function hideNsee() { var HNS = docume ...

The dirtyFields feature in React Hook Form is not accurately capturing all the fields that are dirty or incomplete,

I am facing an issue with one field in my form, endTimeMins, as it is not registering in the formState. I have a total of four fields, and all of them are properly recognized as dirty except for the endTimeMins field. It is worth mentioning that I am utili ...

Use Ajax to dynamically update the href attribute of an ID

I have a page with songs playing in a small audio player, and the songs change every 1-2 minutes or when I choose to (like a radio). Users can vote on each song using the following format: <span class='up'><a href="" class="vote" id="&l ...