1
I need to access the data of a subarray via javascript, I can currently access the content of the entire array:
What I need to take on the case is codigoImpressora
that is inside the subarray impressoraPedido
but I’m not finding anything to help me with that.
Contents of the Array:
{
"empresa":"testes",
"itensPedido":
[
{"impressoraPedido":
{"persistenceId":2,
"persistenceId_string":"2",
"persistenceVersion":0,
"persistenceVersion_string":"0",
"codigoImpressora":"2",
"codEmpresa":3,
"patrimonio":"1327",
"modeloImpressora":"T644",
"setorinstalacao":"Depósito peças"},
"suprimentoPedido":
{"persistenceId":3,
"persistenceId_string":"3",
"persistenceVersion":0,
"persistenceVersion_string":"0",
"codigoModeloImpressora":"2",
"codigoModeloSuprimento":2,
"nomeSuprimento":"TONER LEXMARK T644",
"codModeloSuprimento":"64418XL"},
"quantidadePedido":1}
]
}
This helped me in a way, but how can I do, for example when I have two lines, as I put in the image, in the example you gave worked correctly when you have a line but when you have two or more how I will be able to catch the object "password" respective of each row?
– R.Santos
You commented right at the time I was editing, rs. Just look at the end of the answer.
– Jéf Bueno
He brought number 2 twice for what reason? Another thing, as I will have to display in the second dropdown only the respective content to the first dorpdown selected, as I could add each return of my check to a variable?
– R.Santos
He showed it twice because he has two
console.log
- are two examples. I did not understand the second question, it is not the case of create a new question?– Jéf Bueno
can be, thanks for the help so far :)
– R.Santos
I have created a new question to try to explain my need to you now: https://answall.com/questions/209693/fill-in-content
– R.Santos