Archivo Global.Js
function operativeEvents() { $('.tableButton').off().click(function (e) { var $this = $(this), tableId = $this.parents('table').attr('id'), $table = $('#' + tableId), index = $this.closest('tr').index(), data = $table.bootstrapTable('getData'); //global variable to retrieve the data of the current row window.currentRow = data[index]; buttonActions($this.attr('id'), $this.data('myid')); });La función operativeEvents se vincula cuando se representa el cuerpo de la tabla de arranque. Esto se hace con el evento onPostBody. https://bootstrap-table.com/docs/api/events/
Local.cshtml Esto contiene un caso de interruptor para manejar los clics del botón
function buttonActions(id) { switch (id) { case 'bookButton': bookMatch(currentRow.id); break; } } function bookMatch(currentRow) { bootbox.dialog({ message: '<h4 class="text-center">Are you sure?</h4>', buttons: { cancel: { label: 'Cancel', className: "btn btn-danger" }, confirm: { label: 'Ok', className: 'btn btn-success', callback: function () { alert('testing ' + currentRow); return; updateCall({ url: "/api/MatchesApi/BookMatch/" + currentRow.id, tableRefresh: true, serverSideMessaging: true, }); } } }, }); }Por alguna razón, cuando hago clic en el botón, se abre Bootbox.dialog varias veces. Intenté usar el método off() y también jugué con el burbujeo de eventos. ¿Puede alguien por favor darme un consejo? Gracias :)