Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 1126 Rev 1127
Línea 535... Línea 535...
535
    }
535
    }
536
    /**
536
    /**
537
     * Render Sections data
537
     * Render Sections data
538
     */
538
     */
539
    const renderData = (data) => $("#rows").html($("#behaviorTemplate").render(data));
539
    const renderData = (data) => $("#rows").html($("#behaviorTemplate").render(data));
-
 
540
    /**
-
 
541
     * get alls Behavios
540
    
542
     */
541
    const getAllBehavios = () => {
543
    const getAllBehavios = () => {
542
        $.getJSON("/settings/behaviors" , function(data) {
544
        $.getJSON("/settings/behaviors", function(data) {
543
            console.log(data);
-
 
544
 
-
 
545
            $('#select-conduct').children().remove();
545
            $('#select-conduct').children().remove();
546
 
-
 
547
            $('#select-conduct').append($('<option>', { 
546
            $('#select-conduct').append($('<option>', {
548
        value: '',
547
                value: '',
549
        text : 'LABEL_SELECT'
548
                text: 'LABEL_SELECT'
550
    }));
549
            }));
551
 
-
 
552
            $.each(data.data, function (i, item) {
550
            $.each(data.data, function(i, item) {
553
    $('#select-conduct').append($('<option>', { 
551
                $('#select-conduct').append($('<option>', {
554
        value: item.uuid,
552
                    value: item.uuid,
555
        text : item.description 
553
                    text: item.description
556
    }));
554
                }));
557
});
555
            });
558
        });
556
        });
559
    }
557
    }
-
 
558
    /**
-
 
559
     * Clicked cancel new/edit Form
-
 
560
     */
-
 
561
    $('button.btn-select-conduct').click(function(e) {
-
 
562
        console.log($("#select-conduct").text())
-
 
563
        if ($("#select-conduct").val() == "") {
-
 
564
            $.fn.showError('LABEL_ERROR_SELECT_CONDUCT');
-
 
565
        } else {
-
 
566
            behaviors.push({
-
 
567
                'id': $("#select-conduct").val(),
-
 
568
                'description': $('select[name="select-conduct"] option:selected').text()
-
 
569
            });
-
 
570
            renderData(behaviors);
-
 
571
            getAllBehavios();
-
 
572
        }
-
 
573
    });
560
});
574
});
Línea 561... Línea -...
561
 
-
 
562
 
-
 
563
 
-
 
564
 
575
 
565
JS;
576
JS;
566
$this->inlineScript()->captureEnd();
577
$this->inlineScript()->captureEnd();
Línea 567... Línea 578...
567
?>
578
?>
Línea 688... Línea 699...
688
                           </div>
699
                           </div>
689
                           <div class="col-md-4 col-sm-4 col-xs-12">
700
                           <div class="col-md-4 col-sm-4 col-xs-12">
690
                              <button type="button" class="btn btn-primary" id="btn-select-conduct" data-toggle="tooltip" title="LABEL_ADD LABEL_CONDUCT">LABEL_ADD LABEL_CONDUCT</button>
701
                              <button type="button" class="btn btn-primary" id="btn-select-conduct" data-toggle="tooltip" title="LABEL_ADD LABEL_CONDUCT">LABEL_ADD LABEL_CONDUCT</button>
691
                           </div>
702
                           </div>
692
                           <div class="col-md-4 col-sm-4 col-xs-12 text-right">
703
                           <div class="col-md-4 col-sm-4 col-xs-12 text-right">
693
                              <button type="button"  class="btn btn-primary" id="btn-add-conduct" data-toggle="tooltip" title="LABEL_NEWS LABEL_CONDUCT"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_NEWS LABEL_CONDUCT</button>
704
                              <button type="button" class="btn btn-primary" id="btn-add-conduct" data-toggle="tooltip" title="LABEL_NEWS LABEL_CONDUCT"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_NEWS LABEL_CONDUCT</button>
694
                           </div>
705
                           </div>
695
                        </div>
706
                        </div>
696
                     </div>
707
                     </div>
697
                  </div>
708
                  </div>
698
               </div>
709
               </div>