Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 890 Rev 891
Línea 261... Línea 261...
261
            'status': {
261
            'status': {
262
                required: false,
262
                required: false,
263
            },
263
            },
264
        },
264
        },
265
        submitHandler: function(form) {
265
        submitHandler: function(form) {
-
 
266
            if(behaviors.length==0){
-
 
267
 
-
 
268
                $.fn.showError('Debe ingresar al menos una conducta deseable');
-
 
269
            }else{
-
 
270
 
266
            $.ajax({
271
                $.ajax({
267
                'dataType': 'json',
272
                'dataType': 'json',
268
                'accept': 'application/json',
273
                'accept': 'application/json',
269
                'method': 'post',
274
                'method': 'post',
270
                'url': $('#form').attr('action'),
275
                'url': $('#form').attr('action'),
-
 
276
                'data': {
-
 
277
         
271
                'data': $('#form').serialize()
278
         'name': $('#name').val(),
-
 
279
         'description': $('#description').val(),
-
 
280
         'competency_type_id': $('#competency_type_id').val(),
-
 
281
         'status': $('#status').val(),
-
 
282
         'behaviors': behaviors
-
 
283
     }
272
            }).done(function(response) {
284
            }).done(function(response) {
273
                NProgress.start();
285
                NProgress.start();
274
                if (response['success']) {
286
                if (response['success']) {
275
                    $.fn.showSuccess(response['data']);
287
                    $.fn.showSuccess(response['data']);
276
                    $('#row-form').hide();
288
                    $('#row-form').hide();
Línea 289... Línea 301...
289
            }).fail(function(jqXHR, textStatus, errorThrown) {
301
            }).fail(function(jqXHR, textStatus, errorThrown) {
290
                $.fn.showError(textStatus);
302
                $.fn.showError(textStatus);
291
            }).always(function() {
303
            }).always(function() {
292
                NProgress.done();
304
                NProgress.done();
293
            });
305
            });
-
 
306
 
-
 
307
            }
-
 
308
           
294
            return false;
309
            return false;
295
        },
310
        },
296
        invalidHandler: function(form, validator) {}
311
        invalidHandler: function(form, validator) {}
297
    });
312
    });
298
    $('body').on('click', 'button.btn-add', function(e) {
313
    $('body').on('click', 'button.btn-add', function(e) {