1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
   | $(document).ready(function() {
 
 
    $('.fl_devis_suivi_form').unbind('click');
    $('.fl_devis_suivi_add_piece').unbind('click');
    $('.fl_devis_suivi_add_piece2').unbind('click');
 
    $('#fl_devis_suivi_form_popup_new :input').each(function(){
         $(this).unbind("clone");
         $(this).unbind("change");
    });
 
    init();
 
    //gestion du click sur "?"
   $('.fl_devis_suivi_form').bind("click", function(){
 
       init();
 
//        if (this.id.indexOf('date') != -1) {
//            $(this).datepicker();
//        }
 
        _current_new = $(this).attr('partial_id');
        _url_partial = $(this).attr('url_partial');
        //appel_action_affiche_popup_etape(_current_new, _url_partial);
        ajax_call_with_loader($('#fl_devis_suivi_affiche_popup_etape').val() +
            '?id=' + $('#id').val() + '¤t=' + _current_new + '&url_partial=' + _url_partial,
            'suivi_popup'
        );
 
        init();
 
    });
 
 
    function init(){
        //mise à jour en bdd
        $('#fl_devis_suivi_form_popup_new :input').each(function() {
 
            if (this.id.indexOf('date') != -1) {
                $(this).datepicker();
            }
 
            if($(this).attr('class') != 'fl_devis_suivi_add_piece2'){
 
                 $(this).bind("change", function() {
 
                    ajax_call_nodiv_with_loader(
                    $('#fl_devis_suivi_update_action').val() + '?id=' +  $('#id').val() +
                    '&field=' + this.id + '&value=' + this.value
                    );
                })
            }
      });
    }
 
 
 
            //mise à jour en bdd
        $('#fl_devis_suivi_form_popup_new :input').each(function() {
 
            if (this.id.indexOf('date') != -1) {
                $(this).datepicker();
            }
 
            if($(this).attr('class') != 'fl_devis_suivi_add_piece2'){
 
                 $(this).bind("change", function() {
 
                    ajax_call_nodiv_with_loader(
                    $('#fl_devis_suivi_update_action').val() + '?id=' +  $('#id').val() +
                    '&field=' + this.id + '&value=' + this.value
                    );
                })
            }
      });
}); | 
Partager