Funcition with object

Funcition with object

klermannklermann Posts: 277Questions: 67Answers: 1

Hello I am trying to mount my select and pass object without form editor since I am not able to capture the object inside the form the traditional way. I'm trying through another json object to load my obj, mount, put inside the function and get it on to, so below, but it turns out that the list does not appear, can you help me please?

`function getObjListAll(){

var getDataAjax = $.ajax({
        url: "/financeiro/receitas/listAll",
    }).done(function(obj) {
        var listTR = new Array();
        obj.data.forEach(function(data, i) {
        var nomeTipoReceita = data.tipoReceitas[0].nome;
                    //Mont object
        listTR[i] = { "label": "" + data.tipoReceitas[0].nome + "", "value" : "" + i + ""};
    }) 
    listTipoReceitas(listTR);
});

};`

function listTipoReceitas(listTR){ return listTR; };

{ name: "tipoReceitas", placeholder: 'Tipos', "type": "select", "ipOpts": listTipoReceitas() },

Answers

This discussion has been closed.