Datatable I can not get a return

0
Well I do not know the way to do it, but I need to get the data from when I click on the Datatable to populate a previous screen. This screen opens through a Dialog, I select which one I want to open the registry and popularize the data in another screen. The question is how best to move to another screen, I have managed to do so far below. Only that after I select I do not know how to shoot something on the screen to get the data and display the screen.

function preencheTabelaDeHistoricoProfissional(opcoes) {
    $('#' + opcoes.idTabela).puidatatable({
        scrollable : false,
        columns : [ {
            field : 'anoInicio',
            headerText : 'Ano Início'
        }, {
            field : 'mesInicio',
            headerText : 'Mês Início'
        }, {
            field : 'anoFim',
            headerText : 'Ano Fim'
        }, {
            field : 'mesFim',
            headerText : 'Mês Fim'
        }, {
            field : 'nomeEmpresa',
            headerText : 'Empresa'
        }, {
            field : 'nomeCargo',
            headerText : 'Cargo'
        } ],
        datasource : function(callback) {
            $.ajax({
                type : "GET",
                url : '/populisII-web/rest/historicoProfissional/' + opcoes.idFuncionario,
                dataType : "json",
                context : this,
                success : function(response) {
                    callback.call(this, montaDataSourceHistoricoProfissional(response));
                }
            });
        },
        selectionMode: 'single',
        rowSelect: function(event, data) {
            sessionStorage.removeItem('registroSelecionadoHistoricoProfissional');
            sessionStorage.setItem('registroSelecionadoHistoricoProfissional', data);
        }
    });
}

function montaDataSourceHistoricoProfissional(listaDaChamadaRest) {

    var listaDoDataSource = [];

    $.each(listaDaChamadaRest, function(i, historicoProfissional) {
        listaDoDataSource.push({
            anoInicio : historicoProfissional.recPesHisPK.atrAnoInicio,
            mesInicio : historicoProfissional.recPesHisPK.atrMesInicio,
            anoFim : historicoProfissional.atrAnoFim,
            mesFim : historicoProfissional.atrMesFim,
            nomeEmpresa : historicoProfissional.atrNomeEmpresa,
            nomeCargo : historicoProfissional.atrNomeCargo
        });
    });

    return listaDoDataSource;
}
    
asked by anonymous 31.07.2018 / 00:47

0 answers