Retrieving all raw data in jqGrid: Issues with accessing nested objects

In my grid, the data is structured as follows:

Within the rows (0,1,2 and 3 objects), there are additional objects. Of particular note is an object called 'datosPersonales' ('personalData') which contains sub-objects like nombre (name), apellido1(firstname) etc.

The issue arises when attempting to retrieve data from a single row:

var empleado = $("#GRID_empleado").jqGrid("getRowData",numRow);

Instead of receiving an object with nested objects, 'datosPersonales' appears not as a parent object but rather as individual properties. This can be better understood with an image (from firebug):

For some reason, I am getting the data in the following format:

  • datosPersonales.nombre
  • datosPersonales.apellido1
  • datosPersonales.calle
  • etc

Is there a way to retrieve the entire raw data from a specific row or even the entire grid?

I have experimented with different parameters, but have not achieved success.

My goal is to access the data for [3] in the first image.

Thank you in advance!

Answer №1

You haven't provided any code demonstrating how you are utilizing jqGrid. It's crucial to understand options like datatype and loadonce. Without this information, I can only speculate. Based on the data you have shared, it seems likely that you are setting up a grid with subgrids to showcase all the information. My assumption is that you are following a similar approach to what I have discussed here and here. In this scenario, you can opt to use either getLocalRow or

.jqGrid("getGridParam", "userData")
instead of getRowData. If you are unfamiliar with the references I mentioned, I suggest taking the time to review them.

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

What is the purpose of having a constructor in Typescript when an interface is already used for a class?

Is it necessary to have a constructor in my class if the class already implements an interface? It seems like redundant code to me. interface PersonInterface { firstname: string; lastname: string; email: string; } class Person implements Pe ...

"Unfortunately, the JavaScript external function failed to function properly, but miraculously the inline function

Struggling to create a fullscreen image modal on the web? I was able to get it working fine when embedding the script directly into my HTML file, but as soon as I moved it to an external JS file, things fell apart. I've double-checked all the variable ...

Show a compact graphic in the upper-right-hand corner

Hey, I have this interesting idea but CSS isn't my strong suit. Any thoughts on how to achieve it? I'm looking to create a new class that, when applied to an item (like a div), displays a small clickable pre-defined image in the Top-Right corne ...

javascript code to sort an array of objects within a nested array

I need assistance with removing the deleted status from the children key in a nested array of objects using JavaScript. Currently, when I try to filter out the deleted status, I receive an error stating "cannot return filter of undefined." The goal is to ...

`Is it common to use defined variables from `.env` files in Next.js applications?`

Next.js allows us to utilize environment variable files such as .env.development and .env.production for configuring the application. These files can be filled with necessary environment variables like: NEXT_PUBLIC_API_ENDPOINT="https://some.api.url/a ...

Identifying the device name in Safari on iOS 13 despite the inaccurate display of the user agent - a step-by-step guide

Following the release of Apple's iOS 13, I discovered that window.navigator.userAgent in Safari on iPad iOS 13 is identical to that on MacOS. It appears like this: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) ...

Obtaining data from an external ng-repeat element

My list contains items that are being repeated using ng-repeat details. I want to be able to hover over one of the li elements and have the background of a div called background (which is outside of the ng-repeat) change to the url of the corresponding d ...

Joining strings together using double quotes inside the parentheses of a function

It's recommended to utilize the function in this manner: $function.share("msg");. However, I am interested in appending a variable to the strings. $function.share("https://www.youtube.com/watch?v="+$Id+""); Unfortunately, it seems to be not function ...

What is the best practice for updating state immutably in React using Redux and Redux Toolkit?

As I delve into learning Redux, I've come across a method called addPosts which allows me to add posts to my list. Here's how I'm implementing it: import { createSlice } from "@reduxjs/toolkit"; const initialState = [{ number: 1 } ...

A guide to specifying the Key-Callback pair types in Typescript

Here is an object containing Key-Callback pairs: const entitiesUIEvents = { newEntityButtonClick: () => { history.push("/entity-management/entities/new"); }, openEditEntityDialog: (id) => { history.push(`/entity-mana ...

Setting values from json_decode into respective variables

I am working on building a Restful web service for an Android application using PHP and Slim framework. Currently, I have successfully parsed JSON data but I am looking to store the individual values associated with each key in separate variables. While I ...

Issues with appending new rows using JavaScript

I'm facing an issue with adding rows to the table using this code and I can't seem to find a solution. function add() { document.getElementById("popup").style.display = "block"; document.getElementById("add").addEventListener("click", func ...

Issue with undefined object reference in Moment.js when making an ajax request

Currently, I am working on developing a straightforward booking calendar using Eonasdan's bootstrap-datetimepicker, which relies on the moment.js library. To incorporate localization, I have included the necessary file. My setup consists of linked pic ...

Tips for managing this JavaScript JSON array

Here is an example of a JSON array: var data = { name: 'Mike', level: 1, children: [ { name: 'Susan', level: 2, }, { name: 'Jake', level: 2 }, { name: 'Roy', level: 2 }, ...

Is there a way to verify if the JSON Object array includes the specified value in an array?

I am working with JSON data that contains categories and an array of main categories. categories = [ {catValue:1, catName: 'Arts, crafts, and collectibles'}, {catValue:2, catName: 'Baby'}, {catValue:3, catName: 'Beauty ...

The ng-change directive is used on a dropdown to modify the styling of another HTML element

I need the icon to the left of the input in my HTML form to change based on whether the user selects male or female. However, I am facing an issue where when switching from nothing to female, the icon does not update immediately (even though the ng-change ...

When using Selenium WebDriver to locate an object, an error may occur stating that the result of the xpath expression is "[object Text]" instead of an element as expected

I am currently utilizing Selenium to validate the existence of specific text within a web page. Here is an example of how the HTML appears. <html> <div class="a-content"> <!--!-->==$0 " Text to Locate" <b ...

Tips for reorganizing the JSON data created by Artoo.js?

My file aims to scrape data from a single webpage, but I've hit a roadblock. I initially tried using artoo, request, and cheerio based on my research. Here's the code I have so far: request('http://www.ciclopi.eu/frmLeStazioni.aspx?ID=144&a ...

Having trouble establishing a connection between data in Databricks and the data lake, as well as reading JSON files into

i'm currently working on a project inspired by the content in this blog post: specifically focusing on section 13 - utilizing Chloropleth maps: the code snippet they provide is as follows: import pandas as pd url = ( "https://raw.githubus ...

QT: An easy guide to fetching JSON data from the OMDb API

Currently, I am immersed in a school project that requires the use of The Open Movie Database API. While I believe I have successfully made the request, I am facing difficulty in displaying information such as Title, Year, etc on the UI or even in the cons ...