Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 4113 Rev 4116
Línea 165... Línea 165...
165
            'oAria': {
165
            'oAria': {
166
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
166
                'sSortAscending': ': LABEL_DATATABLE_SSORTASCENDING',
167
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
167
                'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
168
            },
168
            },
169
        },
169
        },
-
 
170
        'drawCallback': function(settings) {
-
 
171
            NProgress.done();
-
 
172
            $('button.btn-delete').confirmation({
-
 
173
                rootSelector: 'button.btn-delete',
-
 
174
                title: 'LABEL_ARE_YOU_SURE',
-
 
175
                singleton: true,
-
 
176
                btnOkLabel: 'LABEL_YES',
-
 
177
                btnCancelLabel: 'LABEL_NO',
-
 
178
                onConfirm: function(value) {
-
 
179
                    action = $(this).data('href');
-
 
180
                    NProgress.start();
-
 
181
                    $.ajax({
-
 
182
                        'dataType': 'json',
-
 
183
                        'accept': 'application/json',
-
 
184
                        'method': 'post',
-
 
185
                        'url': action,
-
 
186
                    }).done(function(response) {
-
 
187
                        if (response['success']) {
-
 
188
                            $.fn.showSuccess(response['data']);
-
 
189
                            gridTable.api().ajax.reload(null, false);
-
 
190
                        } else {
-
 
191
                            $.fn.showError(response['data']);
-
 
192
                        }
-
 
193
                    }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
194
                        $.fn.showError(textStatus);
-
 
195
                    }).always(function() {
-
 
196
                        NProgress.done();
-
 
197
                    });
-
 
198
                }
-
 
199
            });
-
 
200
        },
170
        'aoColumns': [{
201
        'aoColumns': [{
171
                'mDataProp': 'type'
202
                'mDataProp': 'type'
172
            },
203
            },
173
            {
204
            {
174
                'mDataProp': 'name'
205
                'mDataProp': 'name'
Línea 294... Línea 325...
294
        $('#row-form').show();
325
        $('#row-form').show();
295
        $('#row-list').hide();
326
        $('#row-list').hide();
296
        renderData([]);
327
        renderData([]);
297
        return false;
328
        return false;
298
    });
329
    });
-
 
330
    $("button.btn-delete").on('click', function(e) {
-
 
331
    if ($(e.target).closest("button.btn-delete").length === 0) {
-
 
332
        $("button.btn-delete").confirmation('hide');
-
 
333
    }
-
 
334
    });
299
    $('body').on('click', 'button.btn-edit', function(e) {
335
    $('body').on('click', 'button.btn-edit', function(e) {
300
        e.preventDefault();
336
        e.preventDefault();
301
        NProgress.start();
337
        NProgress.start();
302
        var action = $(this).data('href');
338
        var action = $(this).data('href');
303
        $.ajax({
339
        $.ajax({
Línea 330... Línea 366...
330
    $('body').on('click', 'button.btn-refresh', function(e) {
366
    $('body').on('click', 'button.btn-refresh', function(e) {
331
        e.preventDefault();
367
        e.preventDefault();
332
        gridTable.api().ajax.reload(null, false);
368
        gridTable.api().ajax.reload(null, false);
333
        return false;
369
        return false;
334
    });
370
    });
335
    $('button.btn-delete').confirmation({
-
 
336
        rootSelector: 'button.btn-delete',
-
 
337
        title: 'LABEL_ARE_YOU_SURE',
-
 
338
        singleton: true,
-
 
339
        btnOkLabel: 'LABEL_YES',
-
 
340
        btnCancelLabel: 'LABEL_NO',
-
 
341
        onConfirm: function(value) {
-
 
342
            action = $(this).data('href');
-
 
343
            NProgress.start();
-
 
344
            $.ajax({
-
 
345
                'dataType': 'json',
-
 
346
                'accept': 'application/json',
-
 
347
                'method': 'post',
-
 
348
                'url': action,
-
 
349
            }).done(function(response) {
-
 
350
                if (response['success']) {
-
 
351
                    $.fn.showSuccess(response['data']);
-
 
352
                    gridTable.api().ajax.reload(null, false);
-
 
353
                } else {
-
 
354
                    $.fn.showError(response['data']);
-
 
355
                }
-
 
356
            }).fail(function(jqXHR, textStatus, errorThrown) {
-
 
357
                $.fn.showError(textStatus);
-
 
358
            }).always(function() {
-
 
359
                NProgress.done();
-
 
360
            });
-
 
361
        }
-
 
362
    });
-
 
363
    $("button.btn-delete").on('click', function(e) {
-
 
364
        if ($(e.target).closest("button.btn-delete").length === 0) {
-
 
365
            $("button.btn-delete").confirmation('hide');
-
 
366
        }
-
 
367
    });
-
 
368
    $('body').on('click', 'button.btn-import', function(e) {
371
    $('body').on('click', 'button.btn-import', function(e) {
369
        e.preventDefault();
372
        e.preventDefault();
370
        NProgress.start();
373
        NProgress.start();
371
        $.ajax({
374
        $.ajax({
372
            'dataType': 'json',
375
            'dataType': 'json',