Commit dde0c4329c770c94d55c58327504e9792432a274
1 parent
652b1935
Exists in
master
and in
1 other branch
[FIX] Exclusao de registros em listagens via DataTable
Showing
3 changed files
with
7 additions
and
3 deletions
Show diff stats
.gitignore
composer.phar
No preview for this file type
src/Cacic/CommonBundle/Resources/public/js/System.js
@@ -5,15 +5,15 @@ | @@ -5,15 +5,15 @@ | ||
5 | var System = { | 5 | var System = { |
6 | Grid : { // Comportamentos relacionados a itens de grids de listagens de itens | 6 | Grid : { // Comportamentos relacionados a itens de grids de listagens de itens |
7 | excluir : function(){ // Método executado ao acionar a funcionalidade de exclusão | 7 | excluir : function(){ // Método executado ao acionar a funcionalidade de exclusão |
8 | - $( "a.bt-excluir" ).bind( 'click', function(e){ | 8 | + $( 'body' ).delegate( 'a.bt-excluir', 'click', function(e){ |
9 | e.preventDefault(); | 9 | e.preventDefault(); |
10 | var url = $( this ).attr( 'href' ); | 10 | var url = $( this ).attr( 'href' ); |
11 | var id = $( this ).parent().parent().attr( 'id' ).replace( /.*?(\d+)$/, '$1' ); | 11 | var id = $( this ).parent().parent().attr( 'id' ).replace( /.*?(\d+)$/, '$1' ); |
12 | var callback = $( this ).attr( 'data-callback' ); | 12 | var callback = $( this ).attr( 'data-callback' ); |
13 | $( "#System_Excluir" ).data( 'params', { 'url': url, 'id': id, 'callback': callback } ).dialog( "open" ); | 13 | $( "#System_Excluir" ).data( 'params', { 'url': url, 'id': id, 'callback': callback } ).dialog( "open" ); |
14 | }); | 14 | }); |
15 | - | ||
16 | - $( "a.bt-excluir-compositekey" ).bind( 'click', function(e){ // Exclusão de itens com CHAVE COMPOSTA | 15 | + |
16 | + $( 'body' ).delegate( 'a.bt-excluir-compositekey', 'click', function(e){ // Exclusão de itens com CHAVE COMPOSTA | ||
17 | e.preventDefault(); | 17 | e.preventDefault(); |
18 | var url = $( this ).attr( 'href' ); | 18 | var url = $( this ).attr( 'href' ); |
19 | var id = $( this ).parent().parent().attr( 'id' ).replace( /^item_(.*?)$/, '$1' ); // Utilizado para REMOÇÃO do item da GRID | 19 | var id = $( this ).parent().parent().attr( 'id' ).replace( /^item_(.*?)$/, '$1' ); // Utilizado para REMOÇÃO do item da GRID |