10
How to perform string conversion (object array):
[
{"id":1,"nome":"Maluf","cpf":"007.519.591-20"},
{"id":2,"nome":"Paulo Ricardo","cpf":"565.232.591-02"},
{"id":3,"nome":"Joaquim Barbosa","cpf":"007.519.699-32"},
{"id":4,"nome":"Dilma Folgada","cpf":"007.963.000-02"}
]
For an array of arrays:
[
[1,'Maluf','007.519.591-20'],
[2,'Paulo Ricardo','565.232.591-02'],
[3,'Joaquim Barbosa','007.519.699-32'],
[4,'Dilma Folgada','007.963.000-02']
]
Note: Note that in the expected result I do not have the attributes. id, name, Cpf
Explaining the Situation:
I have a component Ext.data.ArrayStore
(Component of the EXTJS library)
var dependentes = new Ext.data.ArrayStore({
fields: [
{name: 'id'},
{name: 'nomeDependente'},
{name: 'cpfDependente'}
]
});
And I have an array like this:
var dados = [
[1, Eduardo, '007.519.591-70'],
[2, 'Fabio', '222.519.111-70']
];
The array data is fixed, correct? But I need to create the data for this array dynamically, because these will only come in the form of string, it is not possible for me to bring data via database, the tool I work with limits me.
Thanks Sergio, helped me a lot. Thank you for helping me in my work.
– durtto
@durtto I’m glad I helped.
– Sergio