-3
I’m in trouble: I mount an object from an insert list:
This list I put in a variable and insert inside a function with foreach, however, so that it works correctly within the function can not have quotes (") in the records; The correct is to stay as follows:
Thus, with the quotes in each record, the final result does not have the data of the Array that is made the function of the foreach, but as written in the first image, it is printed as: ["Bairro: row.bairro"
] because of the quotes. I need to make it look like in the second image.
Return of the Associated variable:
Function without being dynamic:
Function mounting the object:
List for dynamic choice of items:
the guys put negative and didn’t even understand the function, negative us without knowing, instead of helping, can only be beginner...
– Henrique Mendes Silveira Rodri
You could give an example how is your variable "this.Associated"?
– Bruno Cunha
Please click on [Edit] and put the code as text. Putting it as an image is not ideal, understand the reasons reading the FAQ.
– hkotsubo
@Brunocunha, the question is not even the return of this array, because if I do it manually as in 2° image, I can print it correctly, the question is the object that is mounted (dynamically) to choose the items to be printed. So at the end I have an object with the chosen items. However, when I have to join the foreach function, the quotation mark disturbs the function does not print the correct value, the right would be to remove the quotation marks and look like in 2° image
– Henrique Mendes Silveira Rodri
@Henriquemendessilveirarodri, as is its foreach function that is creating the object with the quotation marks, it disappeared from the question?
– Bruno Cunha
@Brunocunha, I do not create the object with the foreach function, the object is a part of the foreach function. is a normal object that I create through a list of options, I will cycle as the user selects and at the end I mount an object, as in the 1° image
– Henrique Mendes Silveira Rodri
@Brunocunha, I put the complete function that generates excel, but it is not dynamic. I want to leave dynamics in the object that composes the line 155 to 175. It’s as if this was hardcode, and I want to leave dynamic, passing an object with the same pattern, but I need to assemble this object without the quotes wrapping each record
– Henrique Mendes Silveira Rodri
Okay, I’m starting to understand, could you just put tbm as is your dynamic function?
– Bruno Cunha
@Brunocunha, I put the function that assembles the object, leaving the dynamics, as well as the list also that is shown. From this list, I just take the last part [Row] as you can see in the function that I mount the object with spread Operator on line 107
– Henrique Mendes Silveira Rodri
Important you [Dit] your question and explain objectively and punctually the difficulty found, accompanied by a [mcve] of the problem and attempt to solve. To better enjoy the site, understand and avoid closures and negativities worth reading the Stack Overflow Survival Guide in English.
– Bacco
@Bacco, thanks for the suggestion, but I edited more than three times talking to Bruno, to have a better understanding, what I intend to do is really complicated, but if you read the whole question I believe it is understandable my problem, in the end it is only about how to take the quotation marks from the records of the object of 1° image
– Henrique Mendes Silveira Rodri