Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 15570 Rev 15571
Línea 55... Línea 55...
55
$this->inlineScript()->captureStart();
55
$this->inlineScript()->captureStart();
56
echo <<<JS
56
echo <<<JS
57
jQuery( document ).ready(function( $ ) {
57
jQuery( document ).ready(function( $ ) {
Línea 58... Línea 58...
58
 
58
 
59
 
59
 
60
    $.fn.loadData = function() {
60
    // $.fn.loadData = function() {
61
        NProgress.start(); 
61
    //     NProgress.start(); 
62
        $.ajax({
62
    //     $.ajax({
63
            'dataType'  : 'json',
63
    //         'dataType'  : 'json',
64
            'accept'    : 'application/json',
64
    //         'accept'    : 'application/json',
65
            'method'    : 'get',
65
    //         'method'    : 'get',
66
            'url'       :  $('#form-filter').attr('action'), 
66
    //         'url'       :  $('#form-filter').attr('action'), 
67
            'data'      :  $('#form-filter').serialize(),
67
    //         'data'      :  $('#form-filter').serialize(),
Línea 68... Línea 68...
68
        }).done(function(response) {
68
    //     }).done(function(response) {
69
            if(response['success']) {
69
    //         if(response['success']) {
Línea 70... Línea 70...
70
 
70
 
71
 
71
 
Línea 72... Línea 72...
72
 
72
 
Línea 73... Línea 73...
73
               $('#gridTable tbody').empty();
73
    //            $('#gridTable tbody').empty();
74
                if(response['data']['items']) { 
74
    //             if(response['data']['items']) { 
75
                    
75
                    
76
                    $('#gridTable tbody').append(
76
    //                 $('#gridTable tbody').append(
77
                        $( "#itemRowTemplate" ).render( response['data']['items'] )
77
    //                     $( "#itemRowTemplate" ).render( response['data']['items'] )
78
    
78
    
79
                    );
79
    //                 );
80
        
80
        
81
                } else {
81
    //             } else {
82
                    $('#gridTable tbody').append(
82
    //                 $('#gridTable tbody').append(
83
                        $( "#itemEmptyRowTemplate" ).render([])
83
    //                     $( "#itemEmptyRowTemplate" ).render([])
84
                    );
84
    //                 );
85
 
85
 
86
                }
86
    //             }
87
 
87
 
88
                if(response['data']['link_download']) {
88
    //             if(response['data']['link_download']) {
89
                    $('button.btn-download').data('href', response['data']['link_download']);
89
    //                 $('button.btn-download').data('href', response['data']['link_download']);
90
                    $('button.btn-download').show();
90
    //                 $('button.btn-download').show();
91
 
91
 
92
                } else {
92
    //             } else {
93
                     $('button.btn-download').hide();
93
    //                  $('button.btn-download').hide();
94
                }
94
    //             }
95
 
95
 
96
            } else {
96
    //         } else {
97
                if(jQuery.type(response['data']) == 'string') {
97
    //             if(jQuery.type(response['data']) == 'string') {
98
                    $.fn.showError(response['data']);
98
    //                 $.fn.showError(response['data']);
99
                } else  {
99
    //             } else  {
100
                    $.each(response['data'], function( fieldname, errors ) {
100
    //                 $.each(response['data'], function( fieldname, errors ) {
101
                        $.fn.showFormErrorValidator('#form-filter #' + fieldname, errors);
101
    //                     $.fn.showFormErrorValidator('#form-filter #' + fieldname, errors);
102
                    });
102
    //                 });
103
                }
103
    //             }
Línea 104... Línea 104...
104
            }
104
    //         }
105
        }).fail(function( jqXHR, textStatus, errorThrown) {
105
    //     }).fail(function( jqXHR, textStatus, errorThrown) {
106
            $.fn.showError(textStatus);
106
    //         $.fn.showError(textStatus);