Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1246 | Rev 1248 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1246 Rev 1247
Línea 68... Línea 68...
68
echo <<<JS
68
echo <<<JS
69
jQuery(document).ready(function($) {
69
jQuery(document).ready(function($) {
70
    var allowEdit = $allowEdit;
70
    var allowEdit = $allowEdit;
71
    var allowDelete = $allowDelete;
71
    var allowDelete = $allowDelete;
72
    var sections = [];
72
    var sections = [];
-
 
73
    var competencies_type = [];
73
    /**
74
    /**
74
     * Get rows and set data table
75
     * Get rows and set data table
75
     */
76
     */
76
    var tableForm = $('#gridTable').dataTable({
77
    var tableForm = $('#gridTable').dataTable({
77
        'processing': true,
78
        'processing': true,
Línea 583... Línea 584...
583
     */
584
     */
584
    $('#job_description_id').on('change', function() {
585
    $('#job_description_id').on('change', function() {
585
        if ($("#job_description_id").val() != '') {
586
        if ($("#job_description_id").val() != '') {
586
            $.getJSON("/settings/jobs-description/edit/" + $("#job_description_id").val(), function(data) {
587
            $.getJSON("/settings/jobs-description/edit/" + $("#job_description_id").val(), function(data) {
587
                if (data['success']) {
588
                if (data['success']) {
588
                    console.log(data['data']['competencies_selected']);
589
                    competencies_type = response['data']['competency_types'];
589
                    renderCompetenciesData(data['data']['competencies_selected']);
590
                    renderCompetenciesData(data['data']['competencies_selected']);
590
                }
591
                }
591
            });
592
            });
592
        }
593
        }
593
    });
594
    });
Línea 594... Línea 595...
594
 
595
 
-
 
596
    /**
-
 
597
     * Filter competencie type
-
 
598
     */
-
 
599
    const filterTypeById = (id) => competencies_type.filter((item) => item.competency_type_id == id ? item : false)[0];
-
 
600
 
595
    /**
601
    /**
596
     * Render Competencies data
602
     * Render Competencies data
597
     */
603
     */
Línea 598... Línea 604...
598
    const renderCompetenciesData = (data) => {
604
    const renderCompetenciesData = (data) => {
599
 
605
 
600
        console.log(data.length);
606
        console.log(data.length);
-
 
607
        data.length > 0 ?
-
 
608
            $("#rows-job-competencies")..html($("#sectionTemplate").render(data, {
601
        data.length > 0 ?
609
                getType: filterTypeById
602
            $("#rows-job-competencies").html($("#competencyTemplate").render(data)) :
610
            })) :
603
            $("#rows-job-competencies").html('');
611
            $("#rows-job-competencies").html('');
604
    }
612
    }