Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 4101 Rev 4107
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
        },
-
 
201
        'aoColumns': [{
170
        'aoColumns': [{
202
                'mDataProp': 'type'
171
                'mDataProp': 'type'
203
            },
172
            },
204
            {
173
            {
205
                'mDataProp': 'name'
174
                'mDataProp': 'name'
Línea 325... Línea 294...
325
        $('#row-form').show();
294
        $('#row-form').show();
326
        $('#row-list').hide();
295
        $('#row-list').hide();
327
        renderData([]);
296
        renderData([]);
328
        return false;
297
        return false;
329
    });
298
    });
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
    });
-
 
335
    $('body').on('click', 'button.btn-edit', function(e) {
299
    $('body').on('click', 'button.btn-edit', function(e) {
336
        e.preventDefault();
300
        e.preventDefault();
337
        NProgress.start();
301
        NProgress.start();
338
        var action = $(this).data('href');
302
        var action = $(this).data('href');
339
        $.ajax({
303
        $.ajax({
Línea 366... Línea 330...
366
    $('body').on('click', 'button.btn-refresh', function(e) {
330
    $('body').on('click', 'button.btn-refresh', function(e) {
367
        e.preventDefault();
331
        e.preventDefault();
368
        gridTable.api().ajax.reload(null, false);
332
        gridTable.api().ajax.reload(null, false);
369
        return false;
333
        return false;
370
    });
334
    });
-
 
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
    });
371
    $('body').on('click', 'button.btn-import', function(e) {
368
    $('body').on('click', 'button.btn-import', function(e) {
372
        e.preventDefault();
369
        e.preventDefault();
373
        NProgress.start();
370
        NProgress.start();
374
        $.ajax({
371
        $.ajax({
375
            'dataType': 'json',
372
            'dataType': 'json',