PivotTable

2

Friends, I need to create a PivotTable in HTML and JavaScript that will work as follows:

I have a series of items in a ComboBox, and while selecting, creates a column in a table. After, I add another ComboBox, where I select another item and after this item creates another column in the Table.

Attached is an example.

Please, could anyone help me?

Thank you very much

    
asked by anonymous 23.09.2015 / 20:21

1 answer

1

You can apdatar this code for your use:

<select class="input-xxlarge empresaRegistro" name="empresaRegistro" id="empresaRegistro" style="width: 715px !important;" onChange="getFuncionario()">
    <option value="">Selecione a Empresa</option>
    <?
        foreach($lista_cedente as $valor){
    ?>
        <option value="<? echo $valor->idCedente; ?>"><? echo $valor->razaosocial; ?></option>
    <? } ?>
</select>

jQuery script:

<script>
        function getFuncionario() {
            var id = $('#empresaRegistro').val();
            $(".idFuncionarioLista").append('<option value="0">Carregando...</option>');
            $.post("<? echo base_url(''); ?>proventos/ajax/funcionario/"+id,
                {idFuncionarioLista:jQuery(id).val()},
                function(valor){
                     $(".idFuncionarioLista").html(valor);
                }
            );
        }

</script>

In this scheme: When you select the Registration Company (field CompanyRegistration), I enter through ajax and search all the data and ready them underneath in a next select field also called idFuncionarioLista. You can do the same type of jquery to fetch the next select, then use onchange="NOMEDAFUNCAO ()" in the select idFuntionaryList for example.

    
23.09.2015 / 20:27